public static void main(String[] args) {
		int result = 0;
		int oldNumber = 0;
		for (int count = 113383; count < 1000000; count++) {
			long answer = count;
			int number = 0;
			while (answer != 1) {
				number++;
				if (answer % 2 == 0) {
					answer /= 2;
				}
				else {
					answer = 3*answer+1;
				}
			}
			if (number > oldNumber) {
				result = count;
				oldNumber = number;
			}
		}
		System.out.println(result);
	}