from collections import Counter def solve(): n,m,t = map(int,input().split()) a = list(map(int,input().split())) counter = Counter(a) def is_ok(x, counter): yoyu = 0 for k,v in counter.items(): if v < x: yoyu += (x-v)//t elif v > x: yoyu -= v-x return yoyu >= 0 ng, ok = -1, 10**9+1 while ok - ng > 1: mid = (ok + ng) // 2 if is_ok(mid, counter): ok = mid else: ng = mid print(ok) if __name__ == "__main__": solve()