#include <bits/stdc++.h>
using namespace std;
int main(void){
int m,n;
cin>>m>>n;
queue<int>q;
int count=0;
while(n--){
int temp;
cin>>temp;
int cond=1;
for(int i=0;i<q.size();i++){
if(temp==q.front()){
cond=0;
break;
}
else{
q.push(q.front());
q.pop();
}
}
if(cond==0){
continue;
}
else{
count++;
if(q.size()<m){
q.push(temp);
}
else{
q.pop();
q.push(temp);
}
}
}
cout<<count;
return 0;
}