#include using namespace std; typedef long long ll; typedef pair P; #define REP(i,n) for(int i=0;i> N >> K; for(i=1;i<=N;i++){ int c; cin >> c; a[c]++; } vector v; for(i=1;i<=N;i++) if(a[i]!=0) v.push_back(a[i]); sort(v.begin(),v.end()); reverse(v.begin(),v.end()); int ans=0,s=0; REP(i,v.size()){ ans++; s+=v[i]; if(s>=K) break; } cout << ans << endl; return 0; }