The last round’s Q3 had quite a few problems, so I’m redoing the question.

The input file **DATA3.txt** will contain 5 lines, each being a binary string of length 1 to 8 – a pattern that should not appear in binary strings in the generated set.

*That is*, if the input is “1”, then the only valid output string is “00000000” (any other binary string of size 8 will contain “1”). A pattern “111111” blocks out:

- 00
**111111** - 0
**111111**0 - 0
**111111**1 - 10
**111111** **111111**00**111111**01**111111**10**111111**11

The output file **OUT3.txt** will contain 5 lines, each being a sum of 1s present in the filtered sets.

*Notes regarding the samples:* “1” filters out everything but “00000000”, which has no 1s, and so the sum is 0. “0” filters out everything but “11111111”, which has eight 1s, so the sum is 8. The only pattern that “00000000” filters out is itself, which doesn’t contribute to the sum anyway. All of the 8-bit binary strings: 1, 10, 11, ..., 11111110, 11111111 contain 1024 1s. Yes, I’ve counted them.

```
1
0
11
00
00000000
```

```
0
8
130
310
1024
```