#include<stdio.h>
int main(void){
  char *s="python3 -c\""
"n,*a=map(int,open(0).read().split())\n"
"d={}\n"
"for i in a:d[i]=d.get(i,0)+1\n"
"print(sum(d[i]-i*(d[i]>=i)for i in d))\n"
"\"";
  system(s);
  return 0;
}            