#include using namespace std; using ll = long long; using Graph = vector>; int main() { int N,K; cin >> N >> K; map dic; for(int i = 0; i < N; i++) { int a; cin >> a; dic[a]++; } map ans; for (const auto& [key, value] : dic) { ans[value]++; } int x = -1; for (const auto& [key, value] : ans) { x = max(value,x); } cout << min(x,K) << endl; }