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

total = []

for a in range(A+1):

    for b in range(B+1):

        for c in range(C+1):

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

            

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

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

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

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