n, m, t = map(int, input().split()) a = [0] * n for v in list(map(int, input().split())): a[v - 1] += 1 ng, ok = 0, 10**18 while ok - ng != 1: vs = (ok + ng) >> 1 cnt = 0 for c in a: if c <= vs: yo = vs - c cnt += yo // t else: cnt -= c - vs if cnt >= 0: ok = vs else: ng = vs print(ok)