from collections import Counter N, M, T = map(int, input().split()) A = list(map(lambda x: int(x) - 1, input().split())) cnt_A = Counter(A) def is_ok(mid): rem = 0 capacity = 0 for k, v in cnt_A.items(): if v > mid: rem += v - mid else: capacity += (mid - v) // T return rem <= capacity ok, ng = 10**18, 0 while abs(ok - ng) > 1: mid = (ok + ng) // 2 if is_ok(mid): ok = mid else: ng = mid print(ok)