def calc(result) return 0 if result < 2 (1..).find { |i| result <= 2 ** i } end puts calc(gets.to_i)