#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e5+10;
ll n,k,p;
ll a[N];
ll last[N];
ll next[N];
ll ans;
bool vis[N];
struct node{
ll nxt,id;
bool operator < (const node&x) const{
return nxt < x.nxt;
}
};
priority_queue <node> q;
int main(){
cin >> n >> k >> p;
for(int i=1;i<=p;i++) cin>>a[i];
for(int i=p;i>=1;i--){
if(!last[a[i]]) next[i] = 1e18+5;
else next[i] = last[a[i]];
last[a[i]]=i;
}
for(int i=1;i<=p;i++){
if(vis[a[i]]){
k++;
node nw;
nw.nxt = next[i];
nw.id = a[i];
q.push(nw);
}
else{
if(q.size()>=k) vis[q.top().id]=0,q.pop();
node nw;
nw.nxt = next[i];
nw.id = a[i];
q.push(nw);
vis[a[i]]=1;
ans++;
}
}
cout << ans;
}