#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200005;
int a[MAXN];
int n, t, c;
void solve() {
  int res = 0;
  for (int i = 0; i <= n - c; i++) {
    if (a[i] <= t) {
      int cnt = 1;
      int j;
      for (j = i + 1; j < n; j++) {
        if (a[j] <= t)
          cnt++;
        else {
          i = j;
          break;
        }
      }
      if (cnt >= c) res += (cnt - c + 1);
      if (j == n) break;
    }
  }
  cout << res << endl;
}
int main() {
  scanf("%d%d%d", &n, &t, &c);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  solve();
  return 0;
}
