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