#!/usr/bin/env python3 #fileencoding: utf-8 N = int(input()) count = 0 while N != 1: if N % 2 == 0: N /= 2 else: N = N//2 + 1 count += 1 print(count)