N = int(input()) ans = 0 while N > 1 : if N & 1 : N += 1 else : while (N & 1) == 0 : N >>= 1 ans += 1 print(ans)