N = int(input()) k = 0 while N > 1: if N % 2 == 0: N = N // 2 else: N += 1 k += 1 print(k)