import sys input = sys.stdin.readline from collections import Counter N,M,T=map(int,input().split()) A=list(map(int,input().split())) C=Counter(A) OK=10**9 NG=0 while OK>NG+1: mid=(OK+NG)//2 rest=0 ko=0 for i in range(1,N+1): x=C[i] if x==mid: pass elif x>mid: rest+=x-mid else: ko+=(mid-x)//T if rest<=ko: OK=mid else: NG=mid print(OK)