#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t, c;
  cin >> n >> t >> c;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  int count = 0;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (arr[i] <= t) {
      count++;
      if (i == n - 1) {
        ans += max(0, count - c + 1);
      }
    } else {
      ans += max(0, count - c + 1);
      count = 0;
    }
  }
  cout << ans;
  return 0;
}
