#include<bits/stdc++.h>
#define X first
#define Y second
#define pb push_back
#define eb pb
#define rep(X,Y) for(int X=0;X<(Y);++X)
#define all(X) (X).begin(),(X).end()

using namespace std;
using ll=long long;

int main(){
	int n,m;
	cin>>n>>m;
	vector<int> usd(n);
	rep(i,m){
		int x;
		cin>>x; --x;
		usd[x]=1;
	}
	int cnt=0;
	while(1){
		int i=n-1;
		while(!usd[i]) --i;
		if(i==m-1) break;
		++cnt;
		int j=0;
		while(usd[j]) ++j;
		swap(usd[i],usd[j]);
	}
	cout<<cnt<<endl;
}

