The prison of your city has n prisoners. As the prison can't accommodate all of them, the city mayor has decided to transfer c of the prisoners to a prison located in another city.

For this reason, he made the n prisoners to stand in a line, with a number written on their chests. The number is the severity of the crime he/she has committed. The greater the number, the more severe his/her crime was.

Then, the mayor told you to choose the c prisoners, who will be transferred to the other prison. He also imposed two conditions. They are,

  The chosen c prisoners has to form a contiguous segment of prisoners.  Any of the chosen prisoner's crime level should not be greater then t. Because, that will make the prisoner a severe criminal and the mayor doesn't want to take the risk of his running away during the transfer. 

Find the number of ways you can choose the c prisoners.


-----Input-----

The first line of input will contain three space separated integers n (1 ≤ n ≤ 2·10^5), t (0 ≤ t ≤ 10^9) and c (1 ≤ c ≤ n). The next line will contain n space separated integers, the i^{th} integer is the severity i^{th} prisoner's crime. The value of crime severities will be non-negative and will not exceed 10^9. 


-----Output-----

Print a single integer — the number of ways you can choose the c prisoners.


-----Examples-----
Input
4 3 3
2 3 1 1

Output
2

Input
1 1 1
2

Output
0

Input
11 4 2
2 2 0 7 3 2 2 4 9 1 4

Output
6

Difficulty: interview

Starter code:

Solutions:
"""
Codeforces Round 244 Div 1 Problem B

Author  : chaotic_iak
Language: Python 3.3.4
"""

class InputHandlerObject(object):
    inputs = []

    def getInput(self, n = 0):
        res = ""
        inputs = self.inputs
        if not inputs: inputs.extend(input().split(" "))
        if n == 0:
            res = inputs[:]
            inputs[:] = []
        while n > len(inputs):
            inputs.extend(input().split(" "))
        if n > 0:
            res = inputs[:n]
            inputs[:n] = []
        return res
InputHandler = InputHandlerObject()
g = InputHandler.getInput

############################## SOLUTION ##############################
n,t,c = [int(x) for x in g()]
a = [False if int(x) > t else True for x in g()]
ct = 0
res = 0
for i in a:
    if i:
        ct += 1
        if ct >= c: res += 1
    else:
        ct = 0
print(res)

n, t, c = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
pref = [0]
for i in range(n):
    if a[i] > t:
        pref.append(pref[-1] + 1)
    else:
        pref.append(pref[-1])
cnt = 0
for i in range(n - c + 1):
    if pref[i] == pref[i + c]:
        cnt += 1
print(cnt)

n, t, c = [int(x) for x in input().split()]
prisoners = [int(x) for x in input().split()]

total = 0
current = 0

for i in prisoners:
    if i > t:
        if (current >= c):
            total += current - c + 1            
        current = 0
    else:
        current += 1

if (current >= c):
    total += current - c + 1

print(total)
            
            


n, t, c = map(int, input().split())
A = map(int, input().split())
B = [0]

for i in A:
    if i > t and B[-1] != 0:
        B.append(0)
    elif i <= t:
        B[-1] += 1

res = 0
for i in B:
    res += 0 if i - c + 1 < 0 else i - c + 1

print(res)

need_log = False
def log(*s):
  if need_log:
    print(*s)

n, t, c = map(int, input().split())
a = list(map(int, input().split()))

if c == 0:
  print(0)
  return

g = []
k = 0
for i in a:
  if i <= t:
    k += 1
  elif k > 0:
    g += [k]
    k = 0
if k > 0:
  g += [k]
log(g)

result = 0

for i in g:
  result += max(i - c + 1, 0)

print(result)

_, t, c = tuple(map(int, str.split(input())))
index = -1
count = 0
for i, ct in enumerate(map(int, str.split(input()))):

    if ct > t:

        index = i

    elif i - index >= c:

         count += 1

print(count)


__author__ = 'Lipen'


def main():
	n,t,c = map(int, input().split())
	v = list(map(int, input().split()))
	k = 0
	answer = 0

	for i in range(n):
		x = v[i]
		if x > t:
			answer += max(0, k-c+1)
			k = 0
		else:
			k+=1
	answer += max(0, k-c+1)

	print(answer)

main()

n, t, c = list(map(int, input().split()))
seq = list(map(int, input().split()))

start, end = 0, 0
res = 0
for i in range(n):
	if seq[i] <= t:
		if end-start+1 == c:
			start += 1
			res += 1
		end += 1
	else:
		start, end = i, i

print(res)


#!/usr/bin/env python

from sys import stdin

n, t, c = list(map(int, stdin.readline().split()))
cnt = 0
ct = 0
for i in map(int, stdin.readline().split()):
    if i <= t:
        ct = ct + 1
    else:
        if ct >= c:
            cnt = cnt + ct - c + 1
        ct = 0
if ct >= c:
    cnt = cnt + ct - c + 1
print(cnt)


n, t, c = list(map(int, input().split()))
ps = list(map(int, input().split()))

bs = []
bs.append(0)
for i in range(n):
    if ps[i] > t:
        bs.append(i + 1)
bs.append(n + 1)

print(sum(bs[i] - bs[i-1] - c for i in range(1, len(bs)) if bs[i] - bs[i-1] > c))


n, t, c = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]
res = 0
cnt = 0
for i in h:
    if i > t:
        cnt = 0
    else:
        cnt += 1
    if cnt >= c:
        res += 1
print(res)


n,t,c=map(int,input().split())
a=list(map(int,input().split()))
b=[0]*n
if a[0]<=t:
    b[0]=c+1
for i in range(1,n):
    if a[i]<=t:
        b[i]=b[i-1]+1
ans=0
for i in range(c-1,n):
    if b[i]>=c:
        ans+=1
print(ans)

n, t, c = list(map(int, input().split()))
ps = list(map(int, input().split()))
s = [0] + [i + 1 for i in range(n) if ps[i] > t] + [n + 1]
print(sum(s[i] - s[i-1] - c for i in range(1, len(s)) if s[i] - s[i-1] > c))


import sys

f = sys.stdin
n, t, c = list(map(int,f.readline().split()))

s = f.readline().split()

total = 0
r = 0 # длинна отрезка
for j in s:
    d = int(j)
    if (d<=t):
        r += 1
    else :
        if r>=c: total += r-c+1
        r = 0

if r>=c: total += r-c+1

print(str(total))    


n, t, c = map(int, input().split())
k, s = c - 1, 0
for i, j in enumerate(map(int, input().split())):
    if j > t:
        s += max(0, i - k)
        k = i + c
print(s + max(0, n - k))

n, t, c = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]

k = 0
p = 0
i = 0

for i in a:
	if i <= t:
		p += 1
	else:
		if p >= c:
			k += p - c + 1
		p = 0

if p >= c:
	k += p - c + 1

print (k)

n, t, c = map(int, input().split())
a = list(map(int, input().split()))
b = 0
ans = 0
for i in range(n):
    if a[i] > t:
       ans += max(i - b - c + 1, 0)
       b = i + 1
ans += max(n - b - c + 1, 0)
print(ans)

n, t, c = tuple(map(int,input().split()))
s = list(map(int,input().split()))
k = 0; i = 0; j = 0
while i < n:
    if s[i] > t: j = 0
    else:
        j += 1
        if j >= c:
            k += 1
    i += 1
print(k)

n, t, c = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
l = 0
i = 0
while i < len(a):
    while i < len(a) and a[i] <= t:
        i += 1
    L = i - l
    if L >= c:
        cnt += (L - c + 1)
    i += 1
    l = i
print(cnt)

import sys

def __starting_point():
    n, t, c = list(map(int, sys.stdin.readline().split()))
    prisoners = list(map(int, sys.stdin.readline().split()))
    cnt = 0
    risk = 0
    for i in range(c):
        if t < prisoners[i]:
            risk += 1
    if not risk:
        cnt += 1
    for i in range(c, n):
        if t < prisoners[i]:
            risk += 1
        if t < prisoners[i - c]:
            risk -= 1
        if not risk:
            cnt += 1
    print(cnt)


__starting_point()

n = input("")

(n,t,c) = n.split(" ")

line = input("")
line = line.split(" ")
line.append("1000000001")
ans = 0
start = 0
current = 0
for x in range(len(line)):
    if int(line[x]) > int(t):
        ans+= max(0, x-start+1-int(c))
        start = x+1


print(ans)

(n,t,c)=list(map(int,input().split()))
a=list(map(int,input().split()))
nos = ans = 0
lst = -1
for i in range(0,n):    
    if a[i] > t:
        ans += max(i - c - lst ,0)
        lst=i
ans+=max(n   - lst - c,0)
print (ans)



n, t, c = map(int, input().split())
a = list(map(int, input().split()))
s = [0 for i in a]
h = 0
l = 0
def push(i):
  nonlocal h, l, s, a
  while h < l and a[s[l - 1]] <= a[i]:
    l -= 1
  s[l] = i
  l += 1
for i in range(c):
  if a[i] > t:
    push(i)
if h == l:
  ans = 1
else:
  ans = 0
for i in range(c, n):
  if h < l and i - c == s[h]:
    h += 1
  if a[i] > t:
    push(i)
  if h == l:
    ans += 1
print(ans)

N, T, C = map(int, input().split())

pics = [-1]
for index, s in enumerate(map(int, input().split())):
	if s > T:
		pics.append(index)
pics.append(N)

ans = 0
for picIndex, pic in enumerate(pics):
	diff = pic - pics[picIndex - 1] - 1
	ans += max(diff - C + 1, 0)

print(ans)

n, t, c = [int(c) for c in input().split()]
cruelty = [int(c) for c in input().split()]
res = 0
current_length = 0

for i in cruelty:
    if i <= t:
        current_length += 1
    else:
        if current_length >= c:
            res += current_length - c + 1
        current_length = 0

if current_length >= c:
    res += current_length - c + 1

print(res)