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

ans=sum(a*500+b*100+c*50==X for a in range(A+1)for b in range(B+1)for c in range(C+1))

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

ans = 0

for a in range(A + 1):

    if X < 500 * a:

        break

    for b in range(B + 1):

        remainder = X - 500 * a - 100 * b

        if remainder < 0:

            break

        if remainder // 50 > C:

            continue

        ans += 1

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

A, B, C, X = [int(eval(input())) for _ in range(4)]
ans = 0
for a in range(A + 1):
    if X < 500 * a:
        break
    for b in range(B + 1):
        remainder = X - 500 * a - 100 * b
        if remainder < 0:
            break
        if remainder // 50 > C:
            continue
        ans += 1
print(ans)

-A, B, C, X = [int(eval(input())) for _ in [0] * 4] -ans = sum( -    a * 500 + b * 100 + c * 50 == X -    for a in range(A + 1) -    for b in range(B + 1) -    for c in range(C + 1) -) +A, B, C, X = [int(eval(input())) for _ in range(4)] +ans = 0 +for a in range(A + 1): +    if X < 500 * a: +        break +    for b in range(B + 1): +        remainder = X - 500 * a - 100 * b +        if remainder < 0: +            break +        if remainder // 50 > C: +            continue +        ans += 1