l=[int(eval(input())) for i in range(3)]

x=int(eval(input()))

ans=0

count=0

for i in range(1+l[0]):

    for j in range(1+l[1]):

        for k in range(1+l[2]):

            ans=500*i+100*j+50*k

            if ans==x:

                count+=1

print(count)
l=[int(eval(input())) for i in range(3)]

x=int(eval(input()))

ans=0

count=0

for i in range(1+l[0]):

    for j in range(1+l[1]):

        ans=x-500*i-100*j

        

        if ans>=0 and ans<=50*l[2]:

            count+=1

        

print(count)
l = [int(eval(input())) for i in range(3)]
x = int(eval(input()))
ans = 0
count = 0
for i in range(1 + l[0]):
    for j in range(1 + l[1]):
        for k in range(1 + l[2]):
            ans = 500 * i + 100 * j + 50 * k
            if ans == x:
                count += 1
print(count)

l = [int(eval(input())) for i in range(3)]
x = int(eval(input()))
ans = 0
count = 0
for i in range(1 + l[0]):
    for j in range(1 + l[1]):
        ans = x - 500 * i - 100 * j
        if ans >= 0 and ans <= 50 * l[2]:
            count += 1
print(count)

-        for k in range(1 + l[2]): -            ans = 500 * i + 100 * j + 50 * k -            if ans == x: -                count += 1 +        ans = x - 500 * i - 100 * j +        if ans >= 0 and ans <= 50 * l[2]: +            count += 1