// 只有到0的奶牛不会进入循环
#include<bits/stdc++.h>
using namespace std;
const int N = 1010;
int rec[N],n;
int main(){
cin >> n;
for(int i = 1; i <= n; ++i){
int x;
cin >> x;
if(rec[x] != -1) rec[i] = x;
else rec[i] = -1;
if(x == 0)rec[i] = -1;
}
for(int i = 1; i <= n; ++i){
for(int j = 1; j <= n; ++j){
if(rec[rec[j]] == -1)rec[j] = -1;
}
}
int ans = 0;
for(int i = 1; i <= n; ++i){
if(rec[i] == -1)ans ++;
}
cout << ans;
return 0;
}