#include <bits/stdc++.h>
using namespace std;
int n, t, c, a[200000], prob = 0, ans = 0;
int main() {
  cin >> n >> t >> c;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    if (i < c) {
      if (a[i] > t) prob++;
    }
  }
  if (!prob) ans++;
  for (int i = c; i < n; ++i) {
    if (a[i - c] > t) prob--;
    if (a[i] > t) prob++;
    if (!prob) ans++;
  }
  cout << ans;
}
