CodeEff/ECCO huggingface dataset:
# Original solution
# AGC011A - Airport Bus
import sys
input = sys.stdin.readline

def main():
    N, C, K = tuple(map(int, input().rstrip().split()))
    T = sorted(map(int, [input().rstrip() for _ in range(N)]))
    ans, cur, cnt = 0, T[0] + K, 0
    for i in T:
        if i > cur or cnt == C:  # need a new bus
            cur = i + K
            cnt = 1
            ans += 1
        else:  # ride on the current bus
            cnt += 1
    print((ans + 1))


if __name__ == "__main__":
    main()

# Optimized solution
# AGC011A - Airport Bus
def main():
    N, C, K, *T = list(map(int, open(0).read().split()))
    T.sort()
    ans, cur, cnt = 0, T[0] + K, 0
    for i in T:
        if i > cur or cnt == C:  # need a new bus
            cur = i + K
            cnt = 1
            ans += 1
        else:  # ride on the current one
            cnt += 1
    print((ans + 1))


if __name__ == "__main__":
    main()
# Original solution
N,C,K = list(map(int,input().split()))
T = [int(eval(input())) for _ in range(N)]
T.sort()

i = 0
ans = 0
while i < N:
  tmp = i+1
  while tmp < N:
    if tmp < i+C and T[tmp] <= T[i]+K:
      tmp += 1
    else:
      break
  ans += 1
  i = tmp
print(ans)

# Optimized solution
N, C, K = list(map(int, input().split()))
T = [int(eval(input())) for _ in range(N)]
T.sort()
T.append(10**12)

ans = 0
now = T[0]
i = 0

while i < N:
    ans += 1
    num = 0
    while i < N and T[i] <= now+K and num < C:
        num += 1
        i += 1
    now = T[i]
print(ans)
# Original solution
import sys
input = sys.stdin.readline

N,C,K = list(map(int,input().split()))
T = [int(eval(input())) for _ in range(N)]
T.sort()

answer = 0
first = -K
rest = C
for t in T:
    if first + K >= t and rest > 0:
        # 乗れる
        rest -= 1
        continue
    # 乗れない
    answer += 1
    first = t
    rest = C-1

print(answer)

# Optimized solution
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# greedy

N,C,K,*T = list(map(int,read().split()))

T.sort()

bus_t = -K - 100
bus_c = C
answer = 0
for t in T:
    bl = (bus_t + K >= t) and (bus_c + 1 <= C)
    if bl:
        bus_c += 1
        continue
    answer += 1
    bus_t = t
    bus_c = 1

print(answer)
# Original solution
import bisect
kyaku, teiin, jikan = list(map(int, input().split(" ")))
a=sorted([(int)(eval(input())) for i in range(kyaku)])
count = 0
while(True):
  #print(a)
  if len(a) > teiin:
    if a[0] + jikan >= a[teiin]:
      a = a[teiin:]
    else:
      a = a[bisect.bisect_left(a, a[0] + jikan):]
  else:
    if a[0] + jikan >= a[-1]:
      count += 1
      break
    else:
      a = a[bisect.bisect_left(a, a[0] + jikan):]
  count += 1
print(count)

# Optimized solution
n,c,k = list(map(int ,input().split(" ")))
t = sorted([int(eval(input())) for i in range(n)])
total = 0
count = 0
while(count != n):
  temp = 0
  #print(count, total)
  for i in range(c):
    if count + i >= n:
      #print("乗りたい人数を全部さばいた")
      if t[-1] - t[count] <= k:
        #print("最後の人全員載せる")
        count = n
        total += 1
        break
      else:
        temp = 0
        while(count != n):
          #print("残りを何回で載せられるか")
          if t[count + temp] - t[count] <= k:
            temp += 1
          else:
            count += temp + 1
            total += 1
        break
      break
    if t[count + i] - t[count] > k:
      #print("定員を超えた")
      count += i
      total += 1
      break
  else:
    #print("k人全員載せる")
    count += c
    total += 1
    if count == n:
      break
print(total)
# Original solution
#!/usr/bin python3
# -*- coding: utf-8 -*-

from bisect import bisect_left, bisect_right

def main():
    N,C,K = list(map(int, input().split()))
    Ti = list(int(eval(input())) for _ in range(N))
    Ti.sort()
    ret = 0
#    print(Ti)
    while len(Ti)>0:
        Tto = K + Ti[0]
        Ti = Ti[min(C,bisect_right(Ti[:min(C,len(Ti))], Tto)):]
        ret += 1
#        print(Ti)
    print(ret)

if __name__ == '__main__':
    main()

# Optimized solution
#!/usr/bin python3
# -*- coding: utf-8 -*-

from bisect import bisect_left, bisect_right

def main():
    N,C,K = list(map(int, input().split()))
    Ti = list(int(eval(input())) for _ in range(N))
    Ti.sort()
    i = 0
    ret = 0
    while i<N:
        ret += 1
        s = i
        Ts = Ti[i]
        while i<N and Ti[i]<=(Ts+K) and (i-s)<C:
            i += 1

    print(ret)

if __name__ == '__main__':
    main()
# Original solution
def main():
    n, c, k, *t = list(map(int, open(0).read().split()))
    t = sorted(t)
    u = tuple(t)

    count = 0
    i = 0
    while i < n:
        x = u[i] + k
        y = min(i + c - 1, n - 1)
        while True:
            if u[y] <= x:
                break
            y -= 1

        count += 1
        i = y + 1

    print(count)


if __name__ == '__main__':
    main()


# Optimized solution
def main():
    n, c, k, *t = list(map(int, open(0).read().split()))
    t = sorted(t)
    u = tuple(t)

    cnt = 1
    p, l = 0, u[0] + k
    for v in t:
        if v <= l and p < c:
            p += 1
        else:
            cnt += 1
            l = v + k
            p = 1
    print(cnt)


if __name__ == '__main__':
    main()
# Original solution
def main():
    n, c, k, *t = list(map(int, open(0).read().split()))
    t = sorted(t)
    u = tuple(t)

    cnt = 1
    p, l = 0, u[0] + k
    for v in t:
        if v <= l and p < c:
            p += 1
        else:
            cnt += 1
            l = v + k
            p = 1
    print(cnt)


if __name__ == '__main__':
    main()


# Optimized solution
def main():
    n, c, k, *t = list(map(int, open(0).read().split()))
    t.sort()
    u = tuple(t)

    cnt = 1
    p, l = 0, u[0] + k
    for v in t:
        if v <= l and p < c:
            p += 1
        else:
            cnt += 1
            p = 1
            l = v + k
    print(cnt)


if __name__ == '__main__':
    main()
# Original solution
import bisect


def resolve():
    n, c, k = list(map(int, input().split()))
    t = list(int(eval(input())) for _ in range(n))
    t.sort()
    ans = 0
    while t:
        candidates = bisect.bisect_left(t, t[0] + k)
        # candidates = len([tj for tj in t if tj <= t[0] + k])
        num = min(c, candidates)
        t = t[num:]
        ans += 1
    print(ans)


if __name__ == "__main__":
    resolve()


# Optimized solution
def resolve():
    n, c, k = list(map(int, input().split()))
    t = list(int(eval(input())) for _ in range(n))
    t.sort()
    ans = 1
    limit = t[0] + k
    bus = 0
    for i in range(n):
        bus += 1
        if t[i] > limit or bus > c:
            limit = t[i] + k
            ans += 1
            bus = 1
    print(ans)


if __name__ == "__main__":
    resolve()
# Original solution
import sys


def input():
    return sys.stdin.readline()[:-1]


N, C, K = list(map(int, input().split()))
T = [0]*N
for i in range(N):
    T[i] = int(eval(input()))

T.sort()

ans = 0
bus_time = -1
bus_num = 0
for i in range(N):
    # 新しいバス
    if bus_time == -1:
        bus_time = T[i]
        bus_num = 1
        ans += 1
    elif T[i] <= bus_time+K and bus_num <= C:
        bus_num += 1
    else:
        bus_time = T[i]
        bus_num = 1
        ans += 1

    if bus_num == C:
        bus_time = -1
        bus_num = 0
print(ans)


# Optimized solution
import sys


def input():
    return sys.stdin.readline()[:-1]


N, C, K = list(map(int, input().split()))
T = [0]*N
for i in range(N):
    T[i] = int(eval(input()))
T.sort()

ans = 1
bus_time = T[0]
bus_num = 0
for i in range(N):
    if T[i] <= bus_time+K and bus_num < C:
        # 止まっているバスに乗る
        bus_num += 1
    else:
        # 新しいバスが必要
        bus_time = T[i]
        bus_num = 1
        ans += 1

print(ans)
# Original solution
N, C, K = [int(x) for x in input().split()]
T = [int(eval(input())) for _ in range(N)]
T.sort()
depart = T[0] + K  # 出発時刻
passenger = 0  # 乗客数
bus = 1
for i in range(N):
    if passenger >= C or depart < T[i]:  # すでに満員または待ち時間オーバー
        bus += 1
        passenger = 1
        depart = T[i] + K
    else:
        passenger += 1

print(bus)

# Optimized solution
import sys
input = sys.stdin.readline
N, C, K = [int(x) for x in input().split()]
T = [int(eval(input())) for _ in range(N)]
T.sort()
depart = T[0] + K  # 出発時刻
passenger = 0  # 乗客数
bus = 1
for i in range(N):
    if passenger >= C or depart < T[i]:  # すでに満員または待ち時間オーバー
        bus += 1
        passenger = 1
        depart = T[i] + K
    else:
        passenger += 1

print(bus)
# Original solution
N,C,K = list(map(int,input().split()))
T = []
for i in range(N):
    T.append(int(eval(input())))
flag = 0
ans = 1
T = sorted(T)

while flag == 0:
    if C < len(T) or T[-1]-T[0]>=K:
        if C < len(T):
            if T[0]+K<T[C-1]:
                T = [i for i in T if i > T[0]+K]
                ans += 1
            else:
                T = T[C:]
                ans += 1
        else:
            T = [i for i in T if i > T[0]+K]
            ans += 1
    else:
        flag = 1
print(ans)

# Optimized solution
N,C,K=list(map(int,input().split()))
T=[]
for i in range(N):
    p=int(eval(input()))
    T.append(p)
  
ans = 1
T = sorted(T)
ind = 0
 
for i in range(len(T)):
    if T[i] > T[ind]+K:
        ans += 1
        ind = i
    elif i >= ind + C:
        ans += 1
        ind = i
print(ans)
# Original solution
import collections

n, c, k = list(map(int, input().split()))
t = [int(eval(input())) for i in range(n)]

t.sort()

passenger = 0
departure_limit = t[0] + k
bus_cnt = 0

for T in t:
    if passenger+1 > c or T > departure_limit:
        departure_limit = T+k
        passenger = 1
        bus_cnt += 1
    else:
        passenger+=1

print((bus_cnt+1))

# Optimized solution
n, c, k, *t = list(map(int, open(0).read().split()))
t.sort()
tmp = 0
cnt = 0
limit = t[0] + k
for time in t:
    if tmp == c or time > limit:
        limit = time + k
        tmp = 1
        cnt += 1
    else:
        tmp += 1
print((cnt + 1))
# Original solution
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)

# Optimized solution
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)
# Original solution
n,c,k = [int(x) for x in input().split()]
t = []
for _ in range(n):
    t.append(int(eval(input())))
t.sort()

ans = 0
tmp = {"f": 0, "num": c}

for x in t:
    if tmp["f"] >= x and tmp["num"] > 0:
        tmp["num"] -= 1
    else:
        ans += 1
        tmp["num"] = c-1
        tmp["f"] = x+k


print(ans)


# Optimized solution
n,c,k = [int(x) for x in input().split()]
t = [int(eval(input())) for _ in range(n)]
t.sort()
bus = c
f_bus = 0
ans = 0
for i in range(n):
    if t[i] > f_bus or bus == 0:
        ans += 1
        f_bus = t[i]+k
        bus = c-1
    else:
        bus -= 1

print(ans)
# Original solution
N, C, K = list(map(int, input().split()))
T = [int(eval(input())) for i in range(N)]
T.sort()
answer = 0
while len(T) > 0:
    limit = T[0] + K
    counter = 0
    while counter < C:
        if len(T) == 0:
            break
        if T[0] > limit:
            break
        del T[0]
        counter += 1
    answer += 1
print(answer)


# Optimized solution
N, C, K = list(map(int, input().split()))
T = [int(eval(input())) for i in range(N)]
T.sort()
limit = T[0]
answer = 1
counter = 1
for i in range(1,N):
    if T[i] - limit > K or counter == C:
        limit = T[i]
        counter = 1
        answer += 1
    else:
        counter += 1
print(answer)
# Original solution
def main() -> None:
    n, c, k = list(map(int, input().split()))
    t = [int(eval(input())) for _ in range(n)]
    ans = wait_start = wait_people = 0

    for ti in sorted(t):
        if ti - wait_start > k or wait_people == c:
            wait_people = 0
        wait_people += 1

        if wait_people == 1:
            wait_start = ti
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()


# Optimized solution
import sys

def main() -> None:
    n, c, k = list(map(int, input().split()))
    t = [int(sys.stdin.readline()) for _ in range(n)]
    ans = wait_start = wait_people = 0

    for ti in sorted(t):
        if ti - wait_start > k or wait_people == c:
            wait_people = 0
        wait_people += 1

        if wait_people == 1:
            wait_start = ti
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()
# Original solution
N, C, K = list(map(int, input().split()))

T = []
for _ in range(N):
    T.append(int(eval(input())))
T.sort()

buss = []
x, *T = T
bus = [x]
while T:
    while T:
        t, *T = T
        if t <= x + K and len(bus) < C:
            bus.append(t)
        else:
            x = t
            buss.append(bus)
            bus = [x]
            break
buss.append(bus)
print((len(buss)))

# Optimized solution
N, C, K = list(map(int, input().split()))

T = sorted([int(eval(input())) for _ in range(N)])

x = T[0]
p = 1
b = 1
for i in range(1, N):
    if T[i] <= x + K and p < C:
        p += 1
    else:
        x = T[i]
        b += 1
        p = 1
print(b)
# Original solution
n, c, k = list(map(int, input().split()))
arr = [eval(input()) for i in range(n)]
arr.sort()

res = 1
start = arr[0]
cur = c

for pas in arr:
	if c == 0:
		c = cur
		start = pas
		res += 1

	if pas <= start + k:
		c -= 1
	else:
		res += 1
		c = cur -1
		start = pas

print(res)
		


# Optimized solution
n, c, k = list(map(int, input().split()))
arr = [eval(input()) for i in range(n)]
arr.sort()

res = 1
start = arr[0]
cur = c

for pas in arr:
	if c == 0:
		c = cur - 1
		start = pas
		res += 1
		continue

	if pas <= start + k:
		c -= 1
	else:
		res += 1
		c = cur -1
		start = pas

print(res)
# Original solution
n,c,k = list(map(int,input().split()))
t = list(int(eval(input())) for i in range(n))
t.sort()
ans = 0
i = 0
while i < n:
    a = t[i]
    j = i + 1
    z = 1
    for j in range(i+1,min(i+c,n)):
        if a+k >= t[j]:
            z += 1
        else:
            break
    i += z
    ans += 1
print(ans)

# Optimized solution
n,c,k = list(map(int,input().split()))
t = list(int(eval(input())) for i in range(n))
t.sort()
ans = 0
x = t[0]
y = 1
for i in range(1,n):
    if x+k < t[i] or y >= c:
        ans += 1
        x = t[i]
        y = 1
    else:
        y += 1
print((ans+1))
# Original solution
N, C, K = list(map(int, input().split()))
T = sorted([int(eval(input())) for i in range(N)])
array = [T[0]]
arrays = []
s = 0
for i in range(1, len(T)):
    if ((T[i] - T[s]) <= K) and len(array) < C:
        array.append(T[i])
    else:
        arrays.append(array)
        array = [T[i]]
        s = i
print((len(arrays + [array])))

# Optimized solution
N, C, K = list(map(int, input().split()))
T = sorted([int(eval(input())) for i in range(N)])
s = 0
array = [T[0]]
arrays = []
for i in range(1, N):
    if ((T[i] - T[s]) <= K) and (len(array) < C):
        array.append(T[i])
    else:
        arrays.append(array)
        array = [T[i]]
        s = i
print((len(arrays + [array])))
# Original solution
N, C, K = list(map(int, input().split()))
T = []
for _ in range(N):
    T.append((int(eval(input())), False))
    T.append((T[-1][0] + K, True))
T.sort(key=lambda x: (x[0], x[1]))
ans = 0
arrived = 0
head = 0
for t, bo in T:
    if arrived == 0 and not bo:
        head = t
    arrived += not bo
    if (bo and arrived > 0 and head <= t - K) or arrived == C:
        arrived = 0
        ans += 1
        head = 2000000009
if arrived > 0:
    ans += 1
print(ans)

# Optimized solution
N, C, K = list(map(int, input().split()))
T = [int(eval(input())) for _ in range(N)]
T.sort()
ans = 0
first = T[0]
arrived = 0
for t in T:
    if first + K < t or arrived == C:
        ans += 1
        arrived = 0
        first = t
    arrived += 1
print((ans + (arrived > 0)))
# Original solution
# 乗せれるだけ乗っけるのがいいと思うだけなんだけどどうなんでしょう
# なんか実装しにくい 世界一プログラミングが下手
# 二重whileなんてやるからだ forでいいやろ
n, c, k = list(map(int, input().split()))
ans = 0
arr = sorted([int(eval(input())) for _ in range(n)])
cur_passenger = 0
limit = arr[0] + k
for i in range(n):
    if cur_passenger < c and arr[i] <= limit:
        cur_passenger += 1
        # print("{}番目の人は{}のバスに乗せた".format(i, ans))
    else:
        cur_passenger = 1
        limit = arr[i] + k
        ans += 1
        # print("{}番目の人を{}のバスの最初の客にした".format(i, ans))
# あぶれた人を救済
if cur_passenger > 0:
    ans += 1
print(ans)


# Optimized solution
n, c, k = list(map(int, input().split()))
t = sorted([int(eval(input())) for _ in range(n)])
ans = 1
passenger = 0
limit = t[0] + k

for p in t:
    if passenger < c and p <= limit:
        passenger += 1
    else:
        ans += 1
        passenger = 1
        limit = p + k
print(ans)
# Original solution
N, C, K = list(map(int, input().split()))

passengers = sorted([int(eval(input())) for i in range(N)])
res = {}

for p in passengers:
    key = False
    for k in list(res.keys()):
        if k <= p and p <= k + K and res[k] <= C - 1:
            res[k] += 1
            key = True
            break
    if not key:
        res[p] = 1
print((len(res)))


# Optimized solution
N, C, K = list(map(int, input().split()))

passengers = sorted([int(eval(input())) for i in range(N)])
res = 0
bus_time = passengers[0]
bus_count = C
for p in passengers:
    if bus_count == 0 or p - bus_time > K:
        res += 1
        bus_time = p
        bus_count = C - 1
    else:
        bus_count -= 1
if bus_count != C:
    res += 1
print(res)
# Original solution
# -*- coding: utf-8 -*-


#----------
N,C,K = list(map(int, input().rstrip().split()))

T_list = [int(input().strip()) for _ in range(N)]
T_list.sort()

#----------
num_bus=0
i=0
while i < len(T_list):

    # Busに何人乗せられるか時刻を比較
    member_bus=0
    break_flg=False
    for j in range(C):
        if (i+j) < len(T_list):
            if T_list[i+j] <= (T_list[i] + K):
                member_bus += 1

    num_bus += 1
    i = i + member_bus
            

print(num_bus)


# Optimized solution
# -*- coding: utf-8 -*-


#----------
N,C,K = list(map(int, input().rstrip().split()))

T_list = [int(input().strip()) for _ in range(N)]
T_list.sort()

#----------
num_bus=0
i=0
while i < len(T_list):

    # Busに何人乗せられるか時刻を比較
    member_bus=0
    break_flg=False
    for j in range(C):
        if (i+j) < len(T_list):
            if T_list[i+j] <= (T_list[i] + K):
                member_bus += 1
            else:
                break_flg=True
        else:
            break_flg=True
        
        if break_flg:
            break

    num_bus += 1
    i = i + member_bus
            

print(num_bus)
# Original solution
from collections import Counter
n, c, k = list(map(int, input().split()))
time_people = Counter([int(eval(input())) for _ in range(n)])
times = sorted(time_people.keys())
ans = 0
left = 0
right = 0
while time_people[times[-1]] > 0:
    space = c
    while times[left] + k >= times[right] and space > 0:
        new_passenger = min(c, time_people[times[right]])
        space -= new_passenger
        time_people[times[right]] -= new_passenger
        if right >= len(times):
            break
        if time_people[times[right]] == 0:
            right += 1
            if right == len(times):
                break
    ans += 1
    while left < len(times) and time_people[times[left]] <= 0:
        left += 1
print(ans)

# Optimized solution
n, c, k = list(map(int, input().split()))
T = sorted([int(eval(input())) for _ in range(n)])
ans = 1
first = T[0]
pas = 0
for t in T:
    pas += 1
    if t > first + k or pas > c:
        ans += 1
        pas = 1
        first = t
print(ans)
# Original solution
n,c,k=list(map(int,input().split()))
t=[int(eval(input())) for _ in range(n)]+[10**10]
t.sort()
b=1
p=0
while p<n:
  l=t[p]+k
  pp=1
  f=1
  while pp<c and f:
    p+=1
    if t[p]<=l:
      pp+=1
      if pp==c:
        p+=1
    else:
      f=0
  if p<n:
    b+=1
print(b)

# Optimized solution
n,c,k=list(map(int,input().split()))
t=[int(eval(input())) for _ in range(n)]+[10**10]
t.sort()
b=1
p=0
if c==1:
  print(n)
  exit()
while p<n:
  l=t[p]+k
  pp=1
  f=1
  while pp<c and f:
    p+=1
    if t[p]<=l:
      pp+=1
      if pp==c:
        p+=1
    else:
      f=0
  if p<n:
    b+=1
print(b)
# Original solution
n,c,k = list(map(int, input().split()))
Ts = [int(eval(input())) for i in range(n)] + [10**10]
Ts = sorted(Ts)

ans = 0
cnt = 1
flg = 0
prev = Ts[0]
for i in range(1,len(Ts)):
    now = Ts[i]
    if now - prev <= k:
        cnt += 1
    else:
        ans += 1
        cnt = 1
        prev = Ts[i]
    if cnt > c:
        ans += 1
        cnt = 1
        prev = Ts[i]
    # print("i",i,"cnt",cnt,"ans",ans)
print(ans)



# Optimized solution
import sys
input = sys.stdin.readline
n,c,k  = list(map(int, input().split()))
ts = [int(eval(input())) for i in range(n)]
ts.sort()
cnt = 0
ans = 0
end = -1
for i, t in enumerate(ts):
    if end < t:
        cnt = 1
        ans += 1
        end = t + k
    else: # t <= end
        cnt += 1
    if cnt > c:
        cnt = 1
        ans += 1
        end = t + k
print(ans)
# Original solution
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)

# Optimized solution
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)
# Original solution
N, C, K = list(map(int, input().split()))
T = [0 for _ in range(N)]
for i in range(N):
    T[i] = int(eval(input()))
T = sorted(T)

ans = 0
while T != []:
    cnt = 0
    for i in range(len(T)):
        cnt += 1
        if T[i] - T[0] > K or cnt > C:
            T = T[i:]
            ans += 1
            break
        if i == len(T)-1:
            ans += 1
            T = []
print(ans)


# Optimized solution
N, C, K = list(map(int, input().split()))
T = [0 for _ in range(N)]
for i in range(N):
    T[i] = int(eval(input()))
T = sorted(T)

flag = 0
cnt = 0
ans = 0
for i in range(len(T)):
    time = T[i] - T[flag]
    cnt += 1
    if time > K or cnt > C:
        flag = i
        cnt = 1
        ans += 1
print((ans + 1))
# Original solution
N, C, K = list(map(int, input().split()))
users = []
for i in range(N):
    users.append(int(eval(input())))

users = sorted(users, reverse=False)

ans = 0
pos = 0
start = 0

while True:
    count = 0

    if pos == N:
        break
        
    start = users[pos]
#     print("start:{}".format(start))
    for i in range(C):
        if pos+i < N and users[pos+i] <= start+K:
            count += 1
    pos += count
#     print("pos:{}".format(pos))
    ans += 1
#     print("ans:{}".format(ans))

print(ans)

# Optimized solution
N, C, K = list(map(int, input().split()))
users = []
for i in range(N):
    users.append(int(eval(input())))

users = sorted(users, reverse=False)

ans = 0
pos = 0
start = 0

while True:
    count = 0

    if pos == N:
        break
        
    start = users[pos]
#     print("start:{}".format(start))
    for i in range(C):
        if pos+i < N and users[pos+i] <= start+K:
            count += 1
        else:
            break
    pos += count
#     print("pos:{}".format(pos))
    ans += 1
#     print("ans:{}".format(ans))

print(ans)