a, b, c, x = list(map(int, [eval(input()) for _ in range(4)]))

ans = 0

for i in range(a+1):

    for j in range(b+1):

        for k in range(c+1):

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

                ans += 1

print(ans)
A, B, C, X = list(map(int, [eval(input()) for _ in range(4)]))

ans = 0



for a in range(A+1):

    for b in range(B+1):

        for c in range(C+1):

            if 500*a + 100*b + 50*c == X:

                ans += 1



print(ans)

a, b, c, x = list(map(int, [eval(input()) for _ in range(4)]))
ans = 0
for i in range(a + 1):
    for j in range(b + 1):
        for k in range(c + 1):
            if i * 500 + j * 100 + k * 50 == x:
                ans += 1
print(ans)

A, B, C, X = list(map(int, [eval(input()) for _ in range(4)]))
ans = 0
for a in range(A + 1):
    for b in range(B + 1):
        for c in range(C + 1):
            if 500 * a + 100 * b + 50 * c == X:
                ans += 1
print(ans)

-a, b, c, x = list(map(int, [eval(input()) for _ in range(4)])) +A, B, C, X = list(map(int, [eval(input()) for _ in range(4)])) -for i in range(a + 1): -    for j in range(b + 1): -        for k in range(c + 1): -            if i * 500 + j * 100 + k * 50 == x: +for a in range(A + 1): +    for b in range(B + 1): +        for c in range(C + 1): +            if 500 * a + 100 * b + 50 * c == X: