#include <bits/stdc++.h>
using namespace std;
template <class T>
string tostring(T x) {
  ostringstream out;
  out << x;
  return out.str();
}
long long toint(string s) {
  istringstream in(s);
  long long x;
  in >> x;
  return x;
}
int main() {
  int n, t, c, tmp;
  cin >> n >> t >> c;
  vector<int> vec;
  int s = 0;
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    if (tmp > t) {
      vec.push_back(s);
      s = 0;
    } else {
      s++;
    }
  }
  if (s != 0) vec.push_back(s);
  int ans = 0;
  for (int i = 0; i < vec.size(); i++) {
    if (vec[i] >= c) {
      ans += vec[i] - c + 1;
    }
  }
  cout << ans << "\n";
  return 0;
}
