want = gets.to_i #入力値 amount = 1 # index = 0 #指数 while amount < want do amount = 2 ** index index = index + 1 end puts index - 1