@n=gets.to_i n=@n c=0 while n>0 c+=n n=n/2 end p (@n+@n/2*2)-c