def main(): n = int(input()) ans = 0 v = n while v!=1: ans += 1 if v % 2 == 0: v //= 2 else: v += 1 print(ans) if __name__ == '__main__': main()