#C384. Count of Odd Numbers Divisible by 3

    ID: 47311 Type: Default 1000ms 256MiB

Count of Odd Numbers Divisible by 3

Count of Odd Numbers Divisible by 3

You are given a sequence of integers. Your task is to first filter out all the even numbers from this sequence, then count how many of the remaining (odd) numbers are divisible by 3. A number (x) is divisible by 3 if (x \equiv 0 \pmod{3}). For example, in the sequence [1, 2, 3, 4, 5, 6, 7, 8, 9], after filtering out even numbers you get [1, 3, 5, 7, 9], and among these, 3 and 9 are divisible by 3. Hence, the answer is 2. This problem tests your ability to process arrays and apply basic filtering and modular arithmetic.

inputFormat

The input is given via standard input (stdin). The first line contains an integer (n) ((0 \leq n \leq 10^5)) representing the number of integers. The second line contains (n) space-separated integers.

outputFormat

Output a single integer on standard output (stdout) which is the count of odd numbers in the input that are divisible by 3.## sample

9
1 2 3 4 5 6 7 8 9
2