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