#include <bits/stdc++.h>
using namespace std;
int mod = 1000000007;
const double PI = 3.14159265;
int main() {
  long long n, t, c;
  cin >> n >> t >> c;
  vector<long long> clevel;
  for (int i = 0; i < n; i++) {
    long long temp;
    cin >> temp;
    clevel.push_back(temp);
  }
  int count = 0;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (clevel[i] > t) {
      if (count >= c) {
        ans += count - c + 1;
      }
      count = 0;
    } else {
      count++;
    }
  }
  if (count >= c) {
    ans += count - c + 1;
  }
  cout << ans;
}
