from collections import Counter N,M,T = list(map(int,input().split())) A = list(map(lambda x:int(x)-1,input().split())) def check(n): ca = Counter(A) free = 0 for i in range(N): if(n - ca[i] > 0):free += (n - ca[i]) // T ca[i] -= min(n,ca[i]) return sum(ca.values()) <= free ng,ok = 0,10**18 while(ok - ng > 1): mid = (ok+ng)//2 if(check(mid)): ok = mid else: ng = mid print(ok)