"Binary Numbers"

As an example, the integer 5 is represented in binary form by 101. This means, working from right to left:

1*2^0 + 0*2^1 + 1*2^2 = 1+0+4 = 5

Given an input file (decimals.txt) of 500 integers, how many 1s IN TOTAL appear in the file in each numbers binary representation?

Say you had the numbers 5, 7 and 10

5 = 101
7 = 111
10 = 1010
Total number of 1s: 7


A fairly simple challenge, download the text file, convert decimals to binary, remove the 0's and count the 1's

Awnser:

Source: