import itertools



A = int(eval(input()))

B = int(eval(input()))

C = int(eval(input()))

X = int(eval(input()))



available_prices = [500 * a + 100 * b + 50 * c for a, b, c in itertools.product(list(range(A+1)), list(range(B+1)), list(range(C+1)))]

 

cnt = 0

for p in available_prices:

    if p == X:

        cnt += 1



print(cnt)
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)
import itertools

A = int(eval(input()))
B = int(eval(input()))
C = int(eval(input()))
X = int(eval(input()))
available_prices = [
    500 * a + 100 * b + 50 * c
    for a, b, c in itertools.product(
        list(range(A + 1)), list(range(B + 1)), list(range(C + 1))
    )
]
cnt = 0
for p in available_prices:
    if p == X:
        cnt += 1
print(cnt)

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)

-import itertools - -available_prices = [ -    500 * a + 100 * b + 50 * c -    for a, b, c in itertools.product( -        list(range(A + 1)), list(range(B + 1)), list(range(C + 1)) -    ) -] -cnt = 0 -for p in available_prices: -    if p == X: -        cnt += 1 -print(cnt) +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)