public static void main(String[] args) {
		long res = 0;
		int save = 0;
		int runs = 0;
		int tempRuns = 0;
		
		for(int i = 1; i < 1000000; i++)
		{
			res = i;
			tempRuns = 0;
			while(res != 1)
			{
				tempRuns++;
				if(res % 2 == 0)
					res = res / 2;
				else
					res = (res * 3) + 1;
			}
			if(tempRuns > runs)
			{
				runs = tempRuns;
				save = i;
			}
		}
		
		System.out.println(save);
	}