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