#P10295. [CCC 2024 S1] Hat Circle
[CCC 2024 S1] Hat Circle
Problem Description
At a recent party, people are sitting around a round table, where is even. The seats are numbered to in clockwise order. Each person is wearing a hat with a number written on it. Specifically, the person in seat is wearing a hat with the number on it.
Each person is looking at the person directly opposite them in the circle.
Please find the number of people who see a hat with the same number as their own.
Input Format
The first line contains a positive even integer , the number of people at the party.
The next lines each contain a non-negative integer , representing the number written on the hat of person .
Output Format
Output one integer, the number of people who see a hat with the same number as their own.
4
0
1
0
1
4
4
1
0
0
1
0
Hint
[Sample 1 Explanation]
The arrangement of the four seats around the table is shown in the figure below. The number inside each circle is the number on that person’s hat, and the number next to the circle is that person’s index. Note that each person sees a number equal to the number on their own hat. The people in positions and both see the number , and the people in positions and both see the number .

[Sample 2 Explanation]
The arrangement of the four seats around the table is shown in the figure below. The number inside each circle is the number on that person’s hat, and the number next to the circle is that person’s index. Note that each person sees a number that is not equal to the number on their own hat. The people in positions and both see the number , and the people in positions and both see the number .

[Constraints]
This problem uses bundled testdata.
For all testdata, it is guaranteed that and .
The table below shows the distribution of the points:
| Score | Description | Range of | Range of |
|---|---|---|---|
| Very few people; only two possible hat numbers | |||
| Only one possible hat number | |||
| People in odd positions have hat number , and people in even positions have hat number | |||
| A medium number of people | |||
| Many people and many possible hat numbers |
Translated by ChatGPT 5