#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; using vi = vector; using vvi = vector; using vl = vector; using vvl = vector; using vb = vector; using vvb = vector; using vd = vector; using vs = vector; using pii = pair; using pll = pair; using pdd = pair; using vpii = vector; using vpll = vector; using vpdd = vector; const int inf = (1 << 30) - 1; const ll INF = 1LL << 60; //const int MOD = 1000000007; const int MOD = 998244353; int main() { int n, k; cin >> n >> k; vi cnt(n + 1, 0); for (int i = 0; i < n; i++) { int a; cin >> a; cnt[a]++; } sort(cnt.begin(), cnt.end(), greater<>()); int sum = 0; int ans = 0; for (int i = 0; i <= n; i++) { ans++; sum += cnt[i]; if (sum >= k) break; } cout << ans << endl; return 0; }