N, M, T = map(int, input().split()) A = list(map(int, input().split())) times = [0] * N for i in range(M): times[A[i] - 1] += 1 while max(times) - min(times) >= T: times[times.index(max(times))] -= 1 times[times.index(min(times))] += T print(max(times) )