A very brave explorer Petya once decided to explore Paris catacombs. Since Petya is not really experienced, his exploration is just walking through the catacombs.
Catacombs consist of several rooms and bidirectional passages between some pairs of them. Some passages can connect a room to itself and since the passages are built on different depths they do not intersect each other. Every minute Petya arbitrary chooses a passage from the room he is currently in and then reaches the room on the other end of the passage in exactly one minute. When he enters a room at minute _i_, he makes a note in his logbook with number _t__i_:
* If Petya has visited this room before, he writes down the minute he was in this room last time;
* Otherwise, Petya writes down an arbitrary non-negative integer strictly less than current minute _i_.
Initially, Petya was in one of the rooms at minute 0, he didn't write down number _t_0.
At some point during his wandering Petya got tired, threw out his logbook and went home. Vasya found his logbook and now he is curious: what is the minimum possible number of rooms in Paris catacombs according to Petya's logbook?
## Input
The first line contains a single integer _n_ (1 ≤ _n_ ≤ 2·105) — then number of notes in Petya's logbook.
The second line contains _n_ non-negative integers _t_1, _t_2, ..., _t__n_ (0 ≤ _t__i_ < _i_) — notes in the logbook.
## Output
In the only line print a single integer — the minimum possible number of rooms in Paris catacombs.
[samples]
## Note
In the first sample, sequence of rooms Petya visited could be, for example 1 → 1 → 2, 1 → 2 → 1 or 1 → 2 → 3. The minimum possible number of rooms is 2.
In the second sample, the sequence could be 1 → 2 → 3 → 1 → 2 → 1.
Let $ n $ be the number of log entries, and let $ t_1, t_2, \dots, t_n $ be the sequence of timestamps recorded at each step, where $ 0 \leq t_i < i $ for each $ i \in \{1, 2, \dots, n\} $.
Define a function $ f: \{1, 2, \dots, n\} \to \mathbb{N} $, where $ f(i) $ is the room number visited at minute $ i $, and $ f(0) $ is the initial room (unknown, not recorded).
The logbook records: at minute $ i $, Petya entered a room and noted the time $ t_i $, meaning that the room visited at minute $ i $ was **also** visited at minute $ t_i $. That is:
$$
f(i) = f(t_i) \quad \text{for all } i = 1, 2, \dots, n
$$
We are to find the **minimum** number of distinct rooms (i.e., distinct values in the set $ \{f(0), f(1), \dots, f(n)\} $) consistent with these constraints.
Note: $ f(0) $ is not constrained by any $ t_i $, but all $ f(i) $ for $ i \geq 1 $ are forced to equal $ f(t_i) $, and $ t_i < i $, so the constraints form a directed acyclic graph (DAG) over indices $ 0 $ to $ n $, with edges $ i \to t_i $ for $ i \geq 1 $, and $ f $ must be constant on connected components of this DAG.
Thus, the problem reduces to:
> How many distinct connected components are there in the directed graph with nodes $ \{0, 1, \dots, n\} $, and edges $ i \to t_i $ for $ i = 1, \dots, n $?
> (Each component must be assigned a single room label; we want to minimize the total number of distinct labels.)
But note: since each $ i \geq 1 $ has exactly one outgoing edge to $ t_i $, and $ t_i < i $, the structure is a **forest of trees** rooted at nodes with no incoming constraints (i.e., nodes that are never pointed to by any $ t_j $, except possibly 0).
Actually, since each node $ i \geq 1 $ points to some $ t_i < i $, the entire structure is a **forest of trees** with roots in $ \{0\} \cup \{ \text{nodes not pointed to by any } t_i \} $. But 0 is always a root (since $ t_i < i $, and $ t_i \geq 0 $, so no $ t_i = 0 $ forces a constraint on 0 — 0 is the starting point).
However, the key insight is: **each connected component (under the undirected version of the constraint graph) must be assigned one room**. But since the graph is directed from higher index to lower, and we are enforcing $ f(i) = f(t_i) $, then **all nodes in the same connected component (via the undirected version of the constraint graph) must have the same room label**.
But actually, because the constraint is $ f(i) = f(t_i) $, and $ t_i < i $, we can process nodes in increasing order and union the equivalence classes.
This is equivalent to:
We start with room labels assigned arbitrarily. We are forced to assign the same room to $ i $ and $ t_i $. So we can model this as a **union-find** (disjoint set union) problem over indices $ 0 $ to $ n $, where for each $ i = 1 $ to $ n $, we union $ i $ and $ t_i $. The number of distinct connected components after all unions is the **minimum number of rooms**.
But note: we are not forced to assign different rooms to different components — we want the *minimum* number of rooms, so we assign one room per connected component.
Therefore:
> **Minimum number of rooms = number of connected components in the undirected graph on vertices $ \{0, 1, \dots, n\} $, with edges $ \{i, t_i\} $ for $ i = 1 $ to $ n $.**
We can compute this via union-find:
- Start with $ n+1 $ components (each node separate).
- For each $ i = 1 $ to $ n $: union $ i $ and $ t_i $.
- The number of remaining components is the answer.
But note: we can also think greedily.
Alternatively, we can simulate:
Let $ \text{comp} = n + 1 $ (initial number of components: nodes 0 to n).
For each $ i = 1 $ to $ n $:
if $ i $ and $ t_i $ are not yet connected, then union them and decrement $ \text{comp} $ by 1.
Final $ \text{comp} $ is the answer.
But we don’t need to implement union-find explicitly — we can use a DSU or just simulate with a parent array.
However, note that $ t_i < i $, so when we process $ i $, $ t_i $ has already been processed (or is 0), so we can track the component representative of each node as we go.
But the cleanest formalization is:
---
**Formal Statement:**
Let $ V = \{0, 1, 2, \dots, n\} $.
For each $ i \in \{1, 2, \dots, n\} $, add an undirected edge between $ i $ and $ t_i $.
Let $ G = (V, E) $ be the resulting undirected graph, where $ E = \{ \{i, t_i\} \mid i = 1, 2, \dots, n \} $.
Then the minimum number of rooms is the number of connected components of $ G $.
---
**Answer:**
$$
\boxed{\text{number of connected components in the graph } (V, E) \text{ as defined above}}
$$