# coding: utf-8

# Your code here!

a = int(eval(input()))

b = int(eval(input()))

c = int(eval(input()))

money = int(eval(input()))

count = 0



for i in range(a + 1):

    for j in range(b + 1):

        for k in range(c + 1):

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

            if total == money:

                count += 1

                

            

                

print(count)

    
# coding: utf-8

# Your code here!



l = int(eval(input()))

m = int(eval(input()))

n = int(eval(input()))

x = int(eval(input()))



count = 0

for i in range(l + 1):

    p = 500 * i

    for j in range(m + 1):

        q = 100 * j

        for k in range(n + 1):

            r = 50 * k

            if p + q + r == x:

                count += 1

print(count)
# coding: utf-8
# Your code here!
a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
money = int(eval(input()))
count = 0
for i in range(a + 1):
    for j in range(b + 1):
        for k in range(c + 1):
            total = i * 500 + j * 100 + k * 50
            if total == money:
                count += 1
print(count)

# coding: utf-8
# Your code here!
l = int(eval(input()))
m = int(eval(input()))
n = int(eval(input()))
x = int(eval(input()))
count = 0
for i in range(l + 1):
    p = 500 * i
    for j in range(m + 1):
        q = 100 * j
        for k in range(n + 1):
            r = 50 * k
            if p + q + r == x:
                count += 1
print(count)

-a = int(eval(input())) -b = int(eval(input())) -c = int(eval(input())) -money = int(eval(input())) +l = int(eval(input())) +m = int(eval(input())) +n = int(eval(input())) +x = int(eval(input())) -for i in range(a + 1): -    for j in range(b + 1): -        for k in range(c + 1): -            total = i * 500 + j * 100 + k * 50 -            if total == money: +for i in range(l + 1): +    p = 500 * i +    for j in range(m + 1): +        q = 100 * j +        for k in range(n + 1): +            r = 50 * k +            if p + q + r == x: