A control panel holds n relay banks. The state of one bank is encoded as a non-negative integer whose binary representation lists which switches are closed (on): a 1 bit means that switch is on, a 0 bit means it is off.
Count the total number of on-switches across all n banks (that is, the total number of 1 bits over all the given integers).
Input format
Line 1: an integer n.
Line 2: n space-separated non-negative integers, the encoded bank states.
Output format
A single integer: the total number of set (1) bits across all n values.
Constraints
- 1 <= n <= 100000
- 0 <= each value <= 1000000000