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

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

t.sort()



T = 0

cnt = 0

ans = 0

for i in range(n):

  if cnt == 0: #誰も待っていない

    T = t[i] + k

    cnt += 1

  elif t[i] <= T:

    cnt += 1

  elif t[i] > T:

    ans += 1

    cnt = 1

    T = t[i] + k

  if cnt == c:

    ans += 1

    T = 0

    cnt = 0

if cnt != 0: ans += 1

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

t = sorted(list(int(eval(input())) for _ in range(n)))



#Ti以上Ti+k以下のバスに乗る

#定員はC人



T = 0

cnt = 0

bus = 0

for i in range(n):

    if cnt == 0:

        cnt += 1

        T = t[i] + k

    elif T >= t[i]:

        cnt += 1

    elif T < t[i]:

        bus += 1

        cnt = 1

        T = t[i]+k

    if cnt == c:

        bus += 1

        T = 0

        cnt = 0

if cnt != 0: bus += 1

print(bus)
n, c, k = list(map(int, input().split()))
t = [int(eval(input())) for _ in range(n)]
t.sort()
T = 0
cnt = 0
ans = 0
for i in range(n):
    if cnt == 0:  # 誰も待っていない
        T = t[i] + k
        cnt += 1
    elif t[i] <= T:
        cnt += 1
    elif t[i] > T:
        ans += 1
        cnt = 1
        T = t[i] + k
    if cnt == c:
        ans += 1
        T = 0
        cnt = 0
if cnt != 0:
    ans += 1
print(ans)

n, c, k = list(map(int, input().split()))
t = sorted(list(int(eval(input())) for _ in range(n)))
# Ti以上Ti+k以下のバスに乗る
# 定員はC人
T = 0
cnt = 0
bus = 0
for i in range(n):
    if cnt == 0:
        cnt += 1
        T = t[i] + k
    elif T >= t[i]:
        cnt += 1
    elif T < t[i]:
        bus += 1
        cnt = 1
        T = t[i] + k
    if cnt == c:
        bus += 1
        T = 0
        cnt = 0
if cnt != 0:
    bus += 1
print(bus)

-t = [int(eval(input())) for _ in range(n)] -t.sort() +t = sorted(list(int(eval(input())) for _ in range(n))) +# Ti以上Ti+k以下のバスに乗る +# 定員はC人 -ans = 0 +bus = 0 -    if cnt == 0:  # 誰も待っていない +    if cnt == 0: +        cnt += 1 +    elif T >= t[i]: -    elif t[i] <= T: -        cnt += 1 -    elif t[i] > T: -        ans += 1 +    elif T < t[i]: +        bus += 1 -        ans += 1 +        bus += 1 -    ans += 1 -print(ans) +    bus += 1 +print(bus)