Given a natural number
N
- the number of numbers that are input. A pair is any 2 numbers that are entered successively one after another. Determine the number of pairs of numbers whose sum is a multiple of 3.
Input
The first line contains a natural number
N
(N<10
5). The following
N
lines contain numbers, one per line. Each number does not exceed 10
9.
Imprint
Display one number on the screen - the answer to the problem.
Examples
# |
Input |
Output |
1 |
5
4
2
6
5
4 |
2 |
Запрещенные операторы:[