#include using namespace std; using ll=long long; using ld=long double; ld pie=3.141592653589793; ll inf=2000000000000000000; ll mod=998244353; int main(){ ll n; cin >> n; vectora(n); for (ll i = 0; i < n; i++) { cin >> a[i]; } vectorx; x.push_back(n); for (ll i = 0; i < n; i++) { if (a[i]>n) { x.push_back(a[i]); } } sort(x.begin(),x.end()); ll ans=0; for (ll i = 1; i < x.size(); i++) { ans+=x[i]-x[i-1]; } cout << ans << endl; }