Hat Circle | 프로그래밍의 벗 PivotOJ
PivotOJ

Hat Circle

시간 제한: 1000ms메모리 제한: 1024MB출처: CCC 2024 SeniorBOJ 32364

문제

At a recent social gathering, N people sit around a circular table, where N is even. The seats are numbered clockwise from 1 to N. Each person is wearing a hat with a number on it. Specifically, the person at seat i is wearing a hat with the number Hi on it.

Each person looks at the person who is directly across (diametrically opposite) them in the circle.

Determine the number of people who see someone with a hat with the same number as their own.

입력

The first line of input will consist of one even positive integer N, representing the number of people at the social gathering.

The next N lines each contain a single non-negative integer Hi, representing the hat number of person i.

출력

Output a single integer representing the number of people who see their hat number on the person directly across from them.

예제

예제 1

입력
4
0
1
0
1
출력
4

예제 2

입력
4
1
0
0
1
출력
0
코드를 제출하려면 로그인하세요.