A = int(eval(input()))

B = int(eval(input()))

C = int(eval(input()))

X = int(eval(input()))

to = 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:

                to += 1

print(to)
A, B, C, X = [int(eval(input())) for i in range(4)]

ans =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:

                ans += 1

                

print(ans)
A = int(eval(input()))
B = int(eval(input()))
C = int(eval(input()))
X = int(eval(input()))
to = 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:
                to += 1
print(to)

A, B, C, X = [int(eval(input())) for i in range(4)]
ans = 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:
                ans += 1
print(ans)

-A = int(eval(input())) -B = int(eval(input())) -C = int(eval(input())) -X = int(eval(input())) -to = 0 +A, B, C, X = [int(eval(input())) for i in range(4)] +ans = 0 -                to += 1 -print(to) +                ans += 1 +print(ans)