Universal Cup Judging System

Universal Cup

時間限制: 1.0 s 記憶體限制: 1024 MB 總分: 100 可 Hack ✓
统计

Grammy arrives on a planet inhabited by mythical creatures, including a species called Nailoong. Through her interactions, she discovers two rules:

  • Nailoongs always lie.

  • All other creatures may either tell the truth or lie.

There are $n$ creatures on the planet. The $i$-th creature claims: “The creature numbered $a_i$ is a Nailoong.”

Please determine the maximum possible number of Nailoongs among these creatures that could possibly exist under these rules.

Input

The first line of input contains one integer $n$ ($1\le n\le 10^5$).

The second line contains $n$ integers $a_1,a_2,\ldots,a_n$ ($1\le a_i\le n$), where the $i$-th creature claims that the $a_i$-th creature is a Nailoong.

Output

Output one integer, the maximum possible number of Nailoongs among these creatures that could possibly exist under these rules.

Examples

Input 1

6
4 1 1 5 6 5

Output 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.