





"""simple docstring"""




def 					a__				(       snake_case__ ,				snake_case__ ,				snake_case__ ,				snake_case__ ,				snake_case__       )		->      str:
			if index == number_of_items:
						return 0
			lowerCamelCase       =      0
			lowerCamelCase       =      0
			lowerCamelCase       =      knapsack(__snake_case ,				__snake_case ,				__snake_case ,				__snake_case ,				index + 1       )
			if weights[index] <= max_weight:
						lowerCamelCase       =      values[index] + knapsack(
						    __snake_case ,				__snake_case ,				__snake_case ,				max_weight - weights[index] ,				index + 1       )
			return max(__snake_case ,				__snake_case       )


if __name__ == "__main__":
					import doctest

					doctest.testmod()









"""simple docstring"""




def 					a__				(       snake_case__ = 1_00_00_00       )		->      int:
			lowerCamelCase       =      1
			lowerCamelCase       =      1
			lowerCamelCase       =      {1: 1}

			for inputa in range(2 ,				snake_case__       ):
						lowerCamelCase       =      0
						lowerCamelCase       =      inputa

						while True:
									if number in counters:
												counter += counters[number]
												break
									if number % 2 == 0:
												number //= 2
												counter += 1
									else:
												lowerCamelCase       =      (3 * number) + 1
												counter += 1

						if inputa not in counters:
									lowerCamelCase       =      counter

						if counter > pre_counter:
									lowerCamelCase       =      inputa
									lowerCamelCase       =      counter
			return largest_number


if __name__ == "__main__":
					print(solution(int(input().strip())))



