Universal Cup Judging System

Universal Cup

시간 제한: 1.0 s 메모리 제한: 1024 MB 총점: 100 해킹 가능 ✓
통계

Grammy는 Nailoong이라는 종을 비롯한 신화 속 생물들이 사는 행성에 도착했습니다. 생물들과 교류하면서 다음 두 규칙을 발견했습니다.

  • Nailoong은 항상 거짓말을 합니다.

  • 다른 모든 생물은 진실을 말할 수도 있고 거짓말을 할 수도 있습니다.

행성에는 $n$마리의 생물이 있습니다. $i$번째 생물은 “번호가 $a_i$인 생물은 Nailoong이다.”라고 주장합니다.

이 규칙 아래에서 이 생물들 중 존재할 수 있는 Nailoong의 최대 개수를 구하세요.

입력

입력의 첫 번째 줄에는 정수 $n$ ($1\le n\le 10^5$)이 포함됩니다.

두 번째 줄에는 $n$개의 정수 $a_1,a_2,\ldots,a_n$ ($1\le a_i\le n$)이 포함됩니다. $i$번째 생물은 $a_i$번째 생물이 Nailoong이라고 주장합니다.

출력

이 규칙 아래에서 이 생물들 중 존재할 수 있는 Nailoong의 최대 개수를 나타내는 정수 하나를 출력하세요.

예제

입력 1

6
4 1 1 5 6 5

출력 1

4

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.