#include<bits/stdc++.h>
using namespace std;
int M,N,temp,n{0};queue<int>q;bool panduan{1};
int main(){
cin>>M>>N;
for (int i=0; i<N;++i) {
cin>>temp;panduan=1;
if (q.empty()) {
q.push(temp);n++;
}
for (int j=1; j<=q.size();++j) {
if (temp==q.front()) {
panduan=0;
}
q.push(q.front());q.pop();
}
if (panduan) {
q.push(temp);n++;
if (q.size()>M) {
q.pop();
}
}
}
cout<<n;
return 0;
}

京公网安备 11010502036488号