#include<bits/stdc++.h>

using namespace std;

int main(){

  int n,m;

  cin >> n;
  cin >> m;

  vector<int> a(m);

  for(int i=0;i < m;++i)
	cin >> a[i];

  int cnt = 0;
  int num = 1;
  
  for(int i=0;i < m;++i){
	if(a[i] != num){
	  cnt++;
	  m--;
	  num++;
	  i--;
	}
	else
	  num++;
  }

  cout << cnt << endl;
  
}

