#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, m, i, x, t, c;
  cin >> n >> t >> c;
  vector<int> prison(n);
  vector<int> check;
  for (int i = 0; i < n; i++) {
    cin >> prison[i];
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (prison[i] > t)
      check.push_back(i);
    else if (i < c - 1)
      continue;
    else {
      if (i - (c - 1) == 0 && check.size() == 0)
        ans++;
      else if (i - (c - 1) > 0) {
        if (check.size() != 0) {
          if (i - (c - 1) > check[check.size() - 1]) {
            ans++;
          }
        } else {
          ans++;
        }
      }
    }
  }
  cout << ans << "\n";
}
