A = int(eval(input()))

B = int(eval(input()))

C = int(eval(input()))

x = int(eval(input()))



count = 0

if x % 50 != 0:

    print((0))

else:

    for c in range(C+1):

        for b in range(B+1):

            for a in range(A+1):

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

                    count += 1

    print(count)
A = int(eval(input()))

B = int(eval(input()))

C = int(eval(input()))

x = int(eval(input()))

print((sum([1 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])))
A = int(eval(input()))
B = int(eval(input()))
C = int(eval(input()))
x = int(eval(input()))
count = 0
if x % 50 != 0:
    print((0))
else:
    for c in range(C + 1):
        for b in range(B + 1):
            for a in range(A + 1):
                if c * 50 + b * 100 + a * 500 == x:
                    count += 1
    print(count)

A = int(eval(input()))
B = int(eval(input()))
C = int(eval(input()))
x = int(eval(input()))
print(
    (
        sum(
            [
                1
                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
            ]
        )
    )
)

-count = 0 -if x % 50 != 0: -    print((0)) -else: -    for c in range(C + 1): -        for b in range(B + 1): -            for a in range(A + 1): -                if c * 50 + b * 100 + a * 500 == x: -                    count += 1 -    print(count) +print( +    ( +        sum( +            [ +                1 +                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 +            ] +        ) +    ) +)