a_500 = int(eval(input()))

b_100 = int(eval(input()))

c_50 = int(eval(input()))

x = int(eval(input()))

count = 0

for a in range(a_500+1):

    for b in range(b_100+1):

        for c in range(c_50+1):

            if a*500+b*100+c*50 == x:

                count += 1

print(count)
a_500 = int(eval(input()))

b_100 = int(eval(input()))

c_50 = int(eval(input()))

x = int(eval(input()))

count = 0

for a in range(a_500+1):

    for b in range(b_100+1):

        c_num = int((x-a*500-b*100)/50)

        if c_num in range(c_50+1):

            count += 1

print(count)
a_500 = int(eval(input()))
b_100 = int(eval(input()))
c_50 = int(eval(input()))
x = int(eval(input()))
count = 0
for a in range(a_500 + 1):
    for b in range(b_100 + 1):
        for c in range(c_50 + 1):
            if a * 500 + b * 100 + c * 50 == x:
                count += 1
print(count)

a_500 = int(eval(input()))
b_100 = int(eval(input()))
c_50 = int(eval(input()))
x = int(eval(input()))
count = 0
for a in range(a_500 + 1):
    for b in range(b_100 + 1):
        c_num = int((x - a * 500 - b * 100) / 50)
        if c_num in range(c_50 + 1):
            count += 1
print(count)

-        for c in range(c_50 + 1): -            if a * 500 + b * 100 + c * 50 == x: -                count += 1 +        c_num = int((x - a * 500 - b * 100) / 50) +        if c_num in range(c_50 + 1): +            count += 1