#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int INF = 1<<30;

int main(){
  int n;cin>>n;
  map<int, int> count;
  for(int i=0;i<n;i++){
  	int a;cin>>a;count[a]++;
  }
  int ans=0;
  for(auto itr=count.begin();itr!=count.end();itr++){
  	int d = itr->second - itr->first;
    if(d>=0)ans+=d;
    else ans+=itr->second;
  }
  cout<<ans<<endl;
}