a=int(eval(input())) # 500

b=int(eval(input())) # 100

c=int(eval(input())) # 50

x=int(eval(input()))

sum = []

count = 0



for i in range(0, a+1):

    asum = 500 * i

    for i in range(0, b+1):

        bsum = 100 * i

        for i in range(0, c+1):

            csum = 50 * i

            sum.append(asum + bsum + csum)



for i in sum:

    if i == x:

        count += 1



print(count)

a=int(eval(input())) # 500

b=int(eval(input())) # 100

c=int(eval(input())) # 50

x=int(eval(input()))

count = 0



for i in range(0, a+1):

    for j in range(0, b+1):

        for k in range(0, c+1):

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

                count += 1

print(count)

a = int(eval(input()))  # 500
b = int(eval(input()))  # 100
c = int(eval(input()))  # 50
x = int(eval(input()))
sum = []
count = 0
for i in range(0, a + 1):
    asum = 500 * i
    for i in range(0, b + 1):
        bsum = 100 * i
        for i in range(0, c + 1):
            csum = 50 * i
            sum.append(asum + bsum + csum)
for i in sum:
    if i == x:
        count += 1
print(count)

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

-sum = [] -    asum = 500 * i -    for i in range(0, b + 1): -        bsum = 100 * i -        for i in range(0, c + 1): -            csum = 50 * i -            sum.append(asum + bsum + csum) -for i in sum: -    if i == x: -        count += 1 +    for j in range(0, b + 1): +        for k in range(0, c + 1): +            if 500 * i + 100 * j + 50 * k == x: +                count += 1