N = int(input()) A = list(map(int, input().split())) pos = [0] * (N + 1) for i in range(N): pos[A[i]] = i + 1 res = [] used = [0] * (N + 1) for i in range(1, N + 1): if not used[pos[i]]: res.append(i) used[pos[i] - 1] = 1 print(len(res))