#include<bits/stdc++.h>
#define int long long
using namespace std;
typedef int type;
inline type read() {
type x=0,f=1;
char ch=getchar();
while(!isdigit(ch)) {
if(ch=='-')f=-1;
ch=getchar();
}
while(isdigit(ch)) {
x=(x<<1)+(x<<3)+(ch^48);
ch=getchar();
}
return x*f;
}
inline void write(type x) {
if(x<0)putchar('-'),x=-x;
if(x>9)write(x / 10);
putchar(x%10+'0');
}
int a[1000005],n,k,s;
multiset<int>se;
multiset<int>::iterator it;
signed main() {
n=read(),k=read();
for(register int i=1; i<=n; i++)s=read(),a[s]++;
int ans=0;
for(register int i=1; i<=n; i++)if(a[i]!=0)se.insert(a[i]);
if(k>=*(--se.end())){
cout<<"pigstd";
return 0;
}
for(register int i=1; i<=n; i++) {
int k2=k,ya=a[i]+k;
if(a[i]==0)continue;
for(it=--se.end(); it!=--se.begin(); it--) {
if(ya>=*it)break;
else {
int s=*it;
while(ya<s) {
s--,k2--;
if(k2<0)break;
}
if(k2<0)break;
}
}
if(k2>=0)ans++;
}
write(ans);
return 0;
}