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

count = 0

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 += 1

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

count = 0

for a in range(A+1):

    for b in range(B+1):

        if 0<=X-500*a-100*b<=C*50:

            count += 1

print(count)
A, B, C, X = [int(eval(input())) for i in range(4)]
count = 0
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 += 1
print(count)

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

-        for c in range(C + 1): -            if 500 * a + 100 * b + 50 * c == X: -                count += 1 +        if 0 <= X - 500 * a - 100 * b <= C * 50: +            count += 1