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



y = []

for a in range(A + 1):

    for b in range(B + 1):

        for c in range(C + 1):

            y.append(500 * a + 100 * b + 50 * c)



print((y.count(X)))
A, B, C, X = [int(eval(input())) for _ in range(4)]

print(([500 * a + 100 * b + 50 * c for c in range(C + 1) for b in range(B + 1) for a in range(A + 1)].count(X)))
A, B, C, X = [int(eval(input())) for _ in range(4)]
y = []
for a in range(A + 1):
    for b in range(B + 1):
        for c in range(C + 1):
            y.append(500 * a + 100 * b + 50 * c)
print((y.count(X)))

A, B, C, X = [int(eval(input())) for _ in range(4)]
print(
    (
        [
            500 * a + 100 * b + 50 * c
            for c in range(C + 1)
            for b in range(B + 1)
            for a in range(A + 1)
        ].count(X)
    )
)

-y = [] -for a in range(A + 1): -    for b in range(B + 1): -        for c in range(C + 1): -            y.append(500 * a + 100 * b + 50 * c) -print((y.count(X))) +print( +    ( +        [ +            500 * a + 100 * b + 50 * c +            for c in range(C + 1) +            for b in range(B + 1) +            for a in range(A + 1) +        ].count(X) +    ) +)