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



ans = 0

for i in range(A+1):

    if 500 * i > X:

        break

    for j in range(B+1):

        if 500 * i + 100 * j > X:

            break

        for k in range(C+1):

            if 500 * i + 100 * j + 50 * k > X:

                break

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

                ans += 1



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



ans = 0

for i in range(A+1):

    if 500*i > X:

        break

    for j in range(B+1):

        if 500*i + 100*j > X:

            break

        if X - 500*i - 100*j <= 50*C:

            ans += 1



print(ans)
A, B, C, X = [int(eval(input())) for _ in range(4)]
ans = 0
for i in range(A + 1):
    if 500 * i > X:
        break
    for j in range(B + 1):
        if 500 * i + 100 * j > X:
            break
        for k in range(C + 1):
            if 500 * i + 100 * j + 50 * k > X:
                break
            if 500 * i + 100 * j + 50 * k == X:
                ans += 1
print(ans)

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

-        for k in range(C + 1): -            if 500 * i + 100 * j + 50 * k > X: -                break -            if 500 * i + 100 * j + 50 * k == X: -                ans += 1 +        if X - 500 * i - 100 * j <= 50 * C: +            ans += 1