A = int(eval(input()))

B = int(eval(input()))

C = int(eval(input()))

X = int(eval(input()))



res = 0



for a in range(A+1):

    for b in range(B+1):

        for c in range(C+1):

            calc = a * 500 + b * 100 + c * 50

            if calc == X:

                res += 1



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

B = int(eval(input()))

C = int(eval(input()))

X = int(eval(input()))



cnt = 0

for i in range(A+1):

    for j in range(B+1):

        for k in range(C+1):

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

                cnt += 1

print(cnt)
A = int(eval(input()))
B = int(eval(input()))
C = int(eval(input()))
X = int(eval(input()))
res = 0
for a in range(A + 1):
    for b in range(B + 1):
        for c in range(C + 1):
            calc = a * 500 + b * 100 + c * 50
            if calc == X:
                res += 1
print(res)

A = int(eval(input()))
B = int(eval(input()))
C = int(eval(input()))
X = int(eval(input()))
cnt = 0
for i in range(A + 1):
    for j in range(B + 1):
        for k in range(C + 1):
            if i * 500 + j * 100 + k * 50 == X:
                cnt += 1
print(cnt)

-res = 0 -for a in range(A + 1): -    for b in range(B + 1): -        for c in range(C + 1): -            calc = a * 500 + b * 100 + c * 50 -            if calc == X: -                res += 1 -print(res) +cnt = 0 +for i in range(A + 1): +    for j in range(B + 1): +        for k in range(C + 1): +            if i * 500 + j * 100 + k * 50 == X: +                cnt += 1 +print(cnt)