#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T bigmod(T p, T e, T M) {
  long long ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
  }
  return (T)ret;
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
template <class T>
inline T lcm(T a, T b) {
  a = abs(a);
  b = abs(b);
  return (a / gcd(a, b)) * b;
}
template <class T, class X>
inline bool getbit(T a, X i) {
  T t = 1;
  return ((a & (t << i)) > 0);
}
template <class T, class X>
inline T setbit(T a, X i) {
  T t = 1;
  return (a | (t << i));
}
template <class T, class X>
inline T resetbit(T a, X i) {
  T t = 1;
  return (a & (~(t << i)));
}
inline long long getnum() {
  char c = getchar();
  long long num, sign = 1;
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-') sign = -1;
  for (num = 0; c >= '0' && c <= '9';) {
    c -= '0';
    num = num * 10 + c;
    c = getchar();
  }
  return num * sign;
}
inline long long power(long long a, long long b) {
  long long multiply = 1;
  for (int i = (0); i < (b); i++) {
    multiply *= a;
  }
  return multiply;
}
long long Tree[1000005];
const long long iMax = 1e6 + 10;
void update(int idx, int x) {
  while (idx <= iMax) {
    Tree[idx] += x;
    idx += (idx & -idx);
  }
}
long long query(int idx) {
  long long sum = 0;
  while (idx > 0) {
    sum += Tree[idx];
    idx -= (idx & -idx);
  }
  return sum;
}
int n, m, k, a[200005];
int main() {
  int test, cases = 1;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = (0); i < (n); i++) scanf("%d", &a[i]);
  sort(a, a + n);
  for (int i = (0); i < (n); i++) update(a[i], 1);
  int ans = 0;
  for (int i = 1; i <= 1000000; i++) {
    int l = i, r = min(i + m - 1, 1000000);
    int out = query(r) - query(l - 1);
    if (out >= k) {
      int idx = lower_bound(a, a + n, r) - a;
      if (a[idx] == r) {
        for (int j = idx; j >= 0; j--) {
          update(a[j], -1);
          ans++;
          out--;
          if (out < k) break;
        }
      } else {
        for (int j = idx - 1; j >= 0; j--) {
          update(a[j], -1);
          ans++;
          out--;
          if (out < k) break;
        }
      }
    }
  }
  cout << ans << "\n";
  return 0;
}

### Prompt

Create a solution in cpp for the following problem:

Every evening Vitalya sets n alarm clocks to wake up tomorrow. Every alarm clock rings during exactly one minute and is characterized by one integer ai — number of minute after midnight in which it rings. Every alarm clock begins ringing at the beginning of the minute and rings during whole minute. 

Vitalya will definitely wake up if during some m consecutive minutes at least k alarm clocks will begin ringing. Pay attention that Vitalya considers only alarm clocks which begin ringing during given period of time. He doesn't consider alarm clocks which started ringing before given period of time and continues ringing during given period of time.

Vitalya is so tired that he wants to sleep all day long and not to wake up. Find out minimal number of alarm clocks Vitalya should turn off to sleep all next day. Now all alarm clocks are turned on. 

Input

First line contains three integers n, m and k (1 ≤ k ≤ n ≤ 2·105, 1 ≤ m ≤ 106) — number of alarm clocks, and conditions of Vitalya's waking up. 

Second line contains sequence of distinct integers a1, a2, ..., an (1 ≤ ai ≤ 106) in which ai equals minute on which i-th alarm clock will ring. Numbers are given in arbitrary order. Vitalya lives in a Berland in which day lasts for 106 minutes. 

Output

Output minimal number of alarm clocks that Vitalya should turn off to sleep all next day long.

Examples

Input

3 3 2
3 5 1


Output

1


Input

5 10 3
12 8 18 25 1


Output

0


Input

7 7 2
7 3 4 1 6 5 2


Output

6


Input

2 2 2
1 3


Output

0

Note

In first example Vitalya should turn off first alarm clock which rings at minute 3.

In second example Vitalya shouldn't turn off any alarm clock because there are no interval of 10 consequence minutes in which 3 alarm clocks will ring.

In third example Vitalya should turn off any 6 alarm clocks.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T bigmod(T p, T e, T M) {
  long long ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
  }
  return (T)ret;
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
template <class T>
inline T lcm(T a, T b) {
  a = abs(a);
  b = abs(b);
  return (a / gcd(a, b)) * b;
}
template <class T, class X>
inline bool getbit(T a, X i) {
  T t = 1;
  return ((a & (t << i)) > 0);
}
template <class T, class X>
inline T setbit(T a, X i) {
  T t = 1;
  return (a | (t << i));
}
template <class T, class X>
inline T resetbit(T a, X i) {
  T t = 1;
  return (a & (~(t << i)));
}
inline long long getnum() {
  char c = getchar();
  long long num, sign = 1;
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-') sign = -1;
  for (num = 0; c >= '0' && c <= '9';) {
    c -= '0';
    num = num * 10 + c;
    c = getchar();
  }
  return num * sign;
}
inline long long power(long long a, long long b) {
  long long multiply = 1;
  for (int i = (0); i < (b); i++) {
    multiply *= a;
  }
  return multiply;
}
long long Tree[1000005];
const long long iMax = 1e6 + 10;
void update(int idx, int x) {
  while (idx <= iMax) {
    Tree[idx] += x;
    idx += (idx & -idx);
  }
}
long long query(int idx) {
  long long sum = 0;
  while (idx > 0) {
    sum += Tree[idx];
    idx -= (idx & -idx);
  }
  return sum;
}
int n, m, k, a[200005];
int main() {
  int test, cases = 1;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = (0); i < (n); i++) scanf("%d", &a[i]);
  sort(a, a + n);
  for (int i = (0); i < (n); i++) update(a[i], 1);
  int ans = 0;
  for (int i = 1; i <= 1000000; i++) {
    int l = i, r = min(i + m - 1, 1000000);
    int out = query(r) - query(l - 1);
    if (out >= k) {
      int idx = lower_bound(a, a + n, r) - a;
      if (a[idx] == r) {
        for (int j = idx; j >= 0; j--) {
          update(a[j], -1);
          ans++;
          out--;
          if (out < k) break;
        }
      } else {
        for (int j = idx - 1; j >= 0; j--) {
          update(a[j], -1);
          ans++;
          out--;
          if (out < k) break;
        }
      }
    }
  }
  cout << ans << "\n";
  return 0;
}

```