#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 5, M = 1e4 + 5, OO = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
int main() {
  long long n, t, c;
  cin >> n >> t >> c;
  long long cnt = 0, ans = 0;
  for (int i = 0, x; i <= n; ++i) {
    if (i == n) {
      if (cnt) ans += max(cnt - c + 1, 0 * 1LL), cnt = 0;
      break;
    }
    cin >> x;
    if (x > t)
      ans += max(cnt - c + 1, 0 * 1LL), cnt = 0;
    else
      cnt++;
  }
  cout << ans;
  return 0;
}
