def calcpop(num): return bin(num).count("1") N=int(input()) pos=1 cnt=1 while 1: pos=pos+calcpop(pos) cnt=cnt+1 if pos