a = int(eval(input()))

b = int(eval(input()))

c = int(eval(input()))

x = int(eval(input()))

count = 0

i = 0

while i <= a:

    j = 0

    while j <= b:

        k = 0

        while k <= c:

            if 500 * i + 100 * j + 50 * k == x:

                count += 1

            k += 1

        j += 1

    i += 1

print(count)

a = int(eval(input()))

b = int(eval(input()))

c = int(eval(input()))

x = int(eval(input()))

count = 0

for i in range(a + 1):

    for j in range(b + 1):

        for k in range(c + 1):

            if 500 * i + 100 * j + 50 * k == x:

                count += 1       

print(count)
a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input()))
count = 0
i = 0
while i <= a:
    j = 0
    while j <= b:
        k = 0
        while k <= c:
            if 500 * i + 100 * j + 50 * k == x:
                count += 1
            k += 1
        j += 1
    i += 1
print(count)

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

-i = 0 -while i <= a: -    j = 0 -    while j <= b: -        k = 0 -        while k <= c: +for i in range(a + 1): +    for j in range(b + 1): +        for k in range(c + 1): -            k += 1 -        j += 1 -    i += 1