Kolya is going to make fresh orange juice. He has n oranges of sizes a_1, a_2, ..., a_{n}. Kolya will put them in the juicer in the fixed order, starting with orange of size a_1, then orange of size a_2 and so on. To be put in the juicer the orange must have size not exceeding b, so if Kolya sees an orange that is strictly greater he throws it away and continues with the next one.

The juicer has a special section to collect waste. It overflows if Kolya squeezes oranges of the total size strictly greater than d. When it happens Kolya empties the waste section (even if there are no more oranges) and continues to squeeze the juice. How many times will he have to empty the waste section?


-----Input-----

The first line of the input contains three integers n, b and d (1 ≤ n ≤ 100 000, 1 ≤ b ≤ d ≤ 1 000 000) — the number of oranges, the maximum size of the orange that fits in the juicer and the value d, which determines the condition when the waste section should be emptied.

The second line contains n integers a_1, a_2, ..., a_{n} (1 ≤ a_{i} ≤ 1 000 000) — sizes of the oranges listed in the order Kolya is going to try to put them in the juicer.


-----Output-----

Print one integer — the number of times Kolya will have to empty the waste section.


-----Examples-----
Input
2 7 10
5 6

Output
1

Input
1 5 10
7

Output
0

Input
3 10 10
5 7 7

Output
1

Input
1 1 1
1

Output
0



-----Note-----

In the first sample, Kolya will squeeze the juice from two oranges and empty the waste section afterwards.

In the second sample, the orange won't fit in the juicer so Kolya will have no juice at all.

Difficulty: interview

Starter code:

Solutions:
# You lost the game.
n,b,d = list(map(int, input().split()))
L = list(map(int, input().split()))
r = 0
c = 0
for i in range(n):
    if L[i] <= b:
        c += L[i]
        if c > d:
            r += 1
            c = 0
print(r)


def main():
    n, b, d = map(int, input().split())
    arr = list(map(int, input().split()))
    num = 0
    taken = 0
    for i in arr:
        if (i > b):
            continue
        taken += i
        
        if (taken > d):
            taken = 0
            num += 1
    print(num)
    
main()

import sys

fin = sys.stdin
fout = sys.stdout
n, b, d = list(map(int, fin.readline().split()))
a = list(map(int, fin.readline().split()))
summ = 0
count = 0
for cur in a:
    if cur > b:
        continue
    summ += cur
    if summ > d:
        count += 1
        summ = 0
fout.write(str(count))


n, b, d = map(int, input().split())
arr = map(int, input().split())
d1 = 0
c = 0
for i in arr:
    if i <= b:
        d1 += i
    if d1 > d:
        c += 1
        d1 = 0
print(c)

N, B, D = list(map(int, input().split()))
A = list(map(int, input().split()))
ans = 0
now = 0
for a in A:
    if a <= B:
        now += a
    if now > D:
        ans += 1
        now = 0
print(ans)


from sys import stdin

n, b, d = (int(x) for x in stdin.readline().split())
a = list(int(x) for x in stdin.readline().split())

container = 0
result = 0

for orange in a:
    if orange > b:
        continue
    container += orange
    if container > d:
        result += 1
        container = 0

print(result)


n, b, d = map(int, input().split())
a = list(map(int, input().split()))
c = 0
summ = 0
for i in range(n):
    if a[i] <= b:
        summ += a[i]
    if summ > d:
        c += 1
        summ = 0

print(c)

n, b, d = list(map(int, input().split()))

cur = 0
ans = 0
for a in list(map(int, input().split())):
    if a > b:
        continue
    
    cur += a
    if cur > d:
        cur = 0
        ans += 1

print(ans)


n, lim, d = map(int, input().split())
q = list(map(int, input().split()))
cur = 0
counter = 0
for elem in q:
    if elem > lim:
        continue
    cur += elem
    if cur > d:
        counter += 1
        cur = 0
print(counter)

n, b, d = list(map(int, input().split()))
line = list(map(int, input().split()))
othodes = 0
result = 0
for i in range(n):
    if line[i] <= b:
        othodes += line[i]
    if othodes > d:
        result += 1
        othodes = 0
print(result)        


#putIn = list(map(int, input().split()))
nbd = list(map(int, input().split()))
oranges = list(map(int, input().split()))
numTimesEmptied = 0
total = 0
for orange in oranges:
    if orange <= nbd[1]:
        total += orange
        if total > nbd[2]:
            numTimesEmptied += 1
            total = 0
print(numTimesEmptied)

n, b, d = [int(x) for x in input().split()]
cur = 0
count = 0
xs = [int(x) for x in input().split()]

for i in xs:
    if i > b:
        continue
    else:
        cur += i
        if cur > d:
            count += 1
            cur = 0

print(count)


n, b, d= [int(i) for i in input().split()]
s = [int(i) for i in input().split()]
k = 0
ans = 0
for i in s:
	if i <= b:
		k+=i
		if k > d:
			ans +=1
			k= 0
print(ans)


n,b,d=[int(i) for i in input().strip().split()]
a=[int(i) for i in input().strip().split()]
ans=0
curr_size=0
for i in range(n):
  if a[i]>b:
    continue
  curr_size+=a[i]
  if curr_size>d:
    ans+=1
    curr_size=0
print(ans)

n, b, d = list(map(int, input().split()))
v = 0
cnt = 0
for cur in map(int, input().split()):
    if cur <= b:
        v += cur
        if v > d:
            v = 0
            cnt += 1
print(cnt)


n,b,d=list(map(int,input().split()))
a=list(map(int,input().split()))
q,k=0,0
for i in range(n):
    if a[i]>b:
        continue
    else:
        k+=a[i]
        if k>d:
            q+=1
            k=0
print(q)


from collections import defaultdict
import sys, os, math

def __starting_point():
    #n, m = list(map(int, input().split()))
    n, b, d = map(int, input().split())
    arr = list(map(int, input().split()))
    cnt, sm = 0, 0
    for i in arr:
        if i > b:
            continue
        sm += i
        if sm > d:
            sm = 0
            cnt += 1
    print(cnt)
__starting_point()

n,b,d=map(int,input().split())
lis=list(map(int,input().split()))
empty=0
t1=0
t2=0
for i in lis:
    if i>b:
        continue
    t1+=i
    if t1>d:
        empty+=1
        t1=0
print(empty)

n, b, d = list(map(int, input().split()))
a = list(map(int, input().split()))

ans = 0
i = 0

while i < n:
    sum = 0
    while sum <= d and i < n:
        if a[i] <= b:
            sum += a[i]
        i += 1
    if sum > d:
        ans += 1

print(ans)


n, b, d = list(map(int, input().split(' ')))
a = list(map(int, input().split(' ')))

level = 0
overflows = 0

for ai in a:
    if ai > b: continue
    level += ai
    if level > d:
        overflows += 1
        level = 0
        
print(overflows)


n, b, d = [int(i) for i in input().split()]

oranges = [int(i) for i in input().split()]


total = 0
dispose = 0

for orange in oranges:
    if orange <= b:
        total += orange
    
    if total > d:
        dispose += 1
        total = 0

print(dispose)
    


n, b, d = map(int, input().split())
A = list(map(int, input().split()))
answer = 0
bal = 0
for i in range(n):
    if A[i] <= b:
        bal += A[i]
        if bal > d:
            bal = 0
            answer += 1
print(answer)

n, b, d = list(map(int, input().split()))
a = list(map(int, input().split()))
dd = 0
ans = 0
for ai in a:
    if ai<=b:
        dd += ai
    if dd > d:
        ans += 1
        dd = 0
print(ans)


s=input().split()
n=int(s[0])
b=int(s[1])
d=int(s[2])
k=input().split()
a=0
p=0
for i in k:
	if int(i)<=b:
		p+=int(i)
		if p>d:
			a+=1
			p=0
print(a)