N,M,T = map(int, input().split()) A = list(map(int, input().split())) cnt = [0] * N for i in A: cnt[i-1] += 1 #print(cnt) def is_ok(arg): rest = 0 for i in cnt: if i > arg: rest += i-arg elif i < arg: rest -= (arg-i) // T return rest <= 0 def meguru_bisect(ng, ok): while (abs(ok - ng) > 1): mid = (ok + ng) // 2 if is_ok(mid): ok = mid else: ng = mid return ok id = meguru_bisect(0,10**14) print(id)