from collections import deque

n,c,k,*t = list(map(int,open(0).read().split()))

d = deque(sorted(t)+[float("inf")])

f = d[0]

cnt = ans = 0

while d:

	if d[0]-f <= k:

		del d[0]

		cnt += 1

		if cnt == c:

			f = d[0]

			cnt = 0

			ans += 1

	else:

		f = d.popleft()

		cnt = 1

		ans += 1

print((ans-(c==1)))
from collections import deque



def solve():

	n,c,k,*t = list(map(int,open(0).read().split()))

	d = deque(sorted(t)+[float("inf")])

	fir = d[0]

	cnt = ans = 0

	while d:

		if d[0]-fir <= k:

			del d[0]

			cnt += 1

			if cnt == c:

				fir = d[0]

				cnt = 0

				ans += 1

		else:

			fir = d.popleft()

			cnt = 1

			ans += 1

	print((ans-(c==1)))



	

if __name__=="__main__":

	solve()
from collections import deque

n, c, k, *t = list(map(int, open(0).read().split()))
d = deque(sorted(t) + [float("inf")])
f = d[0]
cnt = ans = 0
while d:
    if d[0] - f <= k:
        del d[0]
        cnt += 1
        if cnt == c:
            f = d[0]
            cnt = 0
            ans += 1
    else:
        f = d.popleft()
        cnt = 1
        ans += 1
print((ans - (c == 1)))

from collections import deque


def solve():
    n, c, k, *t = list(map(int, open(0).read().split()))
    d = deque(sorted(t) + [float("inf")])
    fir = d[0]
    cnt = ans = 0
    while d:
        if d[0] - fir <= k:
            del d[0]
            cnt += 1
            if cnt == c:
                fir = d[0]
                cnt = 0
                ans += 1
        else:
            fir = d.popleft()
            cnt = 1
            ans += 1
    print((ans - (c == 1)))


if __name__ == "__main__":
    solve()

-n, c, k, *t = list(map(int, open(0).read().split())) -d = deque(sorted(t) + [float("inf")]) -f = d[0] -cnt = ans = 0 -while d: -    if d[0] - f <= k: -        del d[0] -        cnt += 1 -        if cnt == c: -            f = d[0] -            cnt = 0 + +def solve(): +    n, c, k, *t = list(map(int, open(0).read().split())) +    d = deque(sorted(t) + [float("inf")]) +    fir = d[0] +    cnt = ans = 0 +    while d: +        if d[0] - fir <= k: +            del d[0] +            cnt += 1 +            if cnt == c: +                fir = d[0] +                cnt = 0 +                ans += 1 +        else: +            fir = d.popleft() +            cnt = 1 -    else: -        f = d.popleft() -        cnt = 1 -        ans += 1 -print((ans - (c == 1))) +    print((ans - (c == 1))) + + +if __name__ == "__main__": +    solve()