void main()
{
    long[] tmp = readln.split.to!(long[]);
    long n = tmp[0], c = tmp[1], k = tmp[2];
    long[] t = new long[n];
    foreach (i; 0 .. n)
    {
        t[i] = readln.chomp.to!long;
    }

    t.sort!"a < b";
    long cnt;
    long a = t[0];
    foreach (ref x; t)
    {
        if (a <= x && x <= a + k && cnt < c)
        {
            x = a;
            ++cnt;
        }
        else
        {
            a = x;
            cnt = 1;
        }
    }

    t.uniq.array.length.writeln;
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.container;
import std.typecons;
import std.ascii;
import std.uni;