n = gets.chomp!.to_i def pokke(pokebis) tmp = 0 count = 0 while pokebis > 1 tmp += pokebis % 2 pokebis /= 2 pokebis += tmp tmp = 0 count += 1 end count end puts pokke(n)