func main()
	var n: int :: cui@inputInt()
	var sum: int :: 0
	var ans: int :: 2 * n
	while(n > 0)
		do sum :+ n
		do n :/ 2
	end while
	do ans :- sum
	do cui@print("\{ans}\n")
end func