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