#C12838. Count the Powers of Two
Count the Powers of Two
Count the Powers of Two
You are given a list of integers. Your task is to count how many of these integers are powers of two. An integer (n) is considered a power of two if and only if (n > 0) and there exists an integer (k \geq 0) such that (n = 2^k).
For example, the number 8 is a power of two since (8 = 2^3), while 0 and any negative numbers are not considered powers of two.
inputFormat
The input is given via standard input (stdin). The first line contains an integer (n) denoting the number of elements in the list. The second line contains (n) space-separated integers.
outputFormat
Output a single integer on standard output (stdout), representing the count of numbers in the list that are powers of two.## sample
7
1 2 4 8 16 32 64
7