#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t, c, ans = 0;
  bool b = false;
  scanf("%d%d%d", &n, &t, &c);
  int a[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  vector<int> v;
  for (int i = 0; i < n; i++) {
    if (a[i] > t) v.push_back(i);
  }
  if ((int)v.size() == 0) {
    cout << n - c + 1;
    return 0;
  }
  for (int i = 0; i < (int)v.size() - 1; i++) {
    if ((v[i + 1] - v[i] - 1) - c + 1 > 0) ans += (v[i + 1] - v[i] - 1) - c + 1;
  }
  if (v[0] - c + 1 > 0) ans += v[0] - c + 1;
  if (n - v.back() - c > 0) ans += n - v.back() - c;
  cout << ans;
}
