Problem list
Log in
#r03229 · Online Judge > GoldOJ

Seat Rejections

Bronze III 2.0 s 1024 MB

Seats $1$ to $100$ start empty. People state a desired seat in order; a person sits if that seat is still empty, otherwise they are rejected. Print how many people are rejected.

Input

Line 1: $n$ ($1 \le n \le 100$). Line 2: the $n$ requested seat numbers ($1$ to $100$).

Output

Print the number of rejected people.

Example 1

Input
5
1 2 3 2 1
Output
2
Source
Online Judge > GoldOJ
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code