from collections import Counter n, k = [int(x) for x in input().split()] a = [int(x) for x in input().split()] c = sorted(Counter(a).values())[::-1] ans = 1 for cc in c: k -= cc if k <= 0: print(ans) break else: ans += 1