n, c, k = list(map(int, input().split()))

t = [int(eval(input())) for _ in range(n)]



t = sorted(t)

cnt_bus = 0

i = 0

while i < n:

    cnt_rider = 0

    l, r = i, min(i + c - 1, n - 1)

    while l <= r:#適当なmidを求める

        mid = (l + r) // 2

        if t[mid] > t[i] + k:

            r = mid - 1

        else:

            #t[mid] <= t[i] + k

            p = mid#最後に乗車する人の番号（仮）

            l = mid + 1



    cnt_rider = p - i + 1

    i += cnt_rider

    cnt_bus += 1

    #print(p, cnt_rider)

print(cnt_bus)
n, c, k = list(map(int, input().split()))

ts = [int(eval(input())) for _ in range(n)]

ts = sorted(ts)



cnt = 0

rider = 0

limit = -1

for t in ts:

    if (rider == c) or not(t <= limit <= (t + k)):

        cnt += 1

        limit = (t + k)

        rider = 1

    else:

        rider += 1



print(cnt)
n, c, k = list(map(int, input().split()))
t = [int(eval(input())) for _ in range(n)]
t = sorted(t)
cnt_bus = 0
i = 0
while i < n:
    cnt_rider = 0
    l, r = i, min(i + c - 1, n - 1)
    while l <= r:  # 適当なmidを求める
        mid = (l + r) // 2
        if t[mid] > t[i] + k:
            r = mid - 1
        else:
            # t[mid] <= t[i] + k
            p = mid  # 最後に乗車する人の番号（仮）
            l = mid + 1
    cnt_rider = p - i + 1
    i += cnt_rider
    cnt_bus += 1
    # print(p, cnt_rider)
print(cnt_bus)

n, c, k = list(map(int, input().split()))
ts = [int(eval(input())) for _ in range(n)]
ts = sorted(ts)
cnt = 0
rider = 0
limit = -1
for t in ts:
    if (rider == c) or not (t <= limit <= (t + k)):
        cnt += 1
        limit = t + k
        rider = 1
    else:
        rider += 1
print(cnt)

-t = [int(eval(input())) for _ in range(n)] -t = sorted(t) -cnt_bus = 0 -i = 0 -while i < n: -    cnt_rider = 0 -    l, r = i, min(i + c - 1, n - 1) -    while l <= r:  # 適当なmidを求める -        mid = (l + r) // 2 -        if t[mid] > t[i] + k: -            r = mid - 1 -        else: -            # t[mid] <= t[i] + k -            p = mid  # 最後に乗車する人の番号（仮） -            l = mid + 1 -    cnt_rider = p - i + 1 -    i += cnt_rider -    cnt_bus += 1 -    # print(p, cnt_rider) -print(cnt_bus) +ts = [int(eval(input())) for _ in range(n)] +ts = sorted(ts) +cnt = 0 +rider = 0 +limit = -1 +for t in ts: +    if (rider == c) or not (t <= limit <= (t + k)): +        cnt += 1 +        limit = t + k +        rider = 1 +    else: +        rider += 1 +print(cnt)