#include <bits/stdc++.h>
using namespace std;
int n, t, c, ans, a[202020];
int main() {
  cin >> n >> t >> c;
  for (int i = 0; i < n; i++) cin >> a[i];
  vector<int> v;
  v.push_back(-1);
  for (int i = 0; i < n; i++) {
    if (a[i] > t) v.push_back(i);
  }
  v.push_back(n);
  for (int i = 1; i < v.size(); i++) {
    ans += max(0, v[i] - v[i - 1] - c);
  }
  cout << ans;
}
