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