#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int n, x, t, c;
  cin >> n >> t >> c;
  vector<int> sizes;
  int curr = 0;
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    if (x > t) {
      if (curr != 0) {
        sizes.emplace_back(curr);
        curr = 0;
      }
    } else {
      curr++;
    }
  }
  if (curr != 0) {
    sizes.emplace_back(curr);
  }
  for (auto sz : sizes) {
    ans += max(sz - c + 1, 0);
  }
  cout << ans;
}
