a = int(eval(input()))

b = int(eval(input()))

c = int(eval(input()))

x = int(eval(input()))





count = 0

for i_a in range(a + 1):

    for i_b in range(b + 1):

        for i_c in range(c + 1):

            if ((i_a * 500) + (i_b * 100) + (i_c * 50)) == x:

                count += 1

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

b = int(eval(input()))

c = int(eval(input()))

x = int(eval(input()))



count = 0

for i_a in range(a+1):

    sum_a = 500 * i_a

    for i_b in range(b+1):

        sum_b = 100 * i_b

        for i_c in range(c+1):

            sum_c = 50 * i_c

            if x == (sum_a + sum_b + sum_c):

                count += 1



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

a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input()))
count = 0
for i_a in range(a + 1):
    sum_a = 500 * i_a
    for i_b in range(b + 1):
        sum_b = 100 * i_b
        for i_c in range(c + 1):
            sum_c = 50 * i_c
            if x == (sum_a + sum_b + sum_c):
                count += 1
print(count)

+    sum_a = 500 * i_a +        sum_b = 100 * i_b -            if ((i_a * 500) + (i_b * 100) + (i_c * 50)) == x: +            sum_c = 50 * i_c +            if x == (sum_a + sum_b + sum_c):