first = input() chalks = [int(first)] breakTimes = 0 while True: chalk = chalks.pop(0) if chalk < 1: pass else: x = (chalk-1)/2 chalk = chalk-x-1 chalks.append(chalk) chalks.append(x) breakTimes+=1 if chalks == []: break print(breakTimes) print("")