want = gets.to_i #入力値:必要なビスケットの枚数 amount = 1 #持っているビスケットの枚数 index = 0 #指数 while amount < want do index = index + 1 amount = 2 ** index end puts index