#include using namespace std; int main() { int n, k; cin >> n >> k; vector a(n + 1); set s; for (int i = 1; i <= n; ++i) { cin >> a[i]; s.insert(a[i]); } cout << min(k, (int)s.size()); return 0; }