AdvancedRating 1500
Ones From 0 to N
Print the total number of 1 bits in the binary forms of all integers from 0 to n.
Input
One integer n (0 ≤ n ≤ 10¹⁸).
Output
A count.
Sample 1
Input
5
Output
7
Sample 2
Input
0
Output
0
Output appears hereOne integer n (0 ≤ n ≤ 10¹⁸).
A count.
5
7
0
0
Output appears here