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

cnt = 0

for i in range(A+1):

    for j in range(B+1):

        for k in range(C+1):

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

                cnt+=1

print(cnt)
a = int(eval(input()))

b = int(eval(input()))

c = int(eval(input()))

x = int(eval(input()))

ans = 0



for i in range(a+1):

    for j in range(b+1):

        for k in range(c+1):

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

                ans += 1

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

a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input()))
ans = 0
for i in range(a + 1):
    for j in range(b + 1):
        for k in range(c + 1):
            if 500 * i + 100 * j + 50 * k == x:
                ans += 1
print(ans)

-A, B, C, X = [int(eval(input())) for x in range(4)] -cnt = 0 -for i in range(A + 1): -    for j in range(B + 1): -        for k in range(C + 1): -            if X == 500 * i + 100 * j + 50 * k: -                cnt += 1 -print(cnt) +a = int(eval(input())) +b = int(eval(input())) +c = int(eval(input())) +x = int(eval(input())) +ans = 0 +for i in range(a + 1): +    for j in range(b + 1): +        for k in range(c + 1): +            if 500 * i + 100 * j + 50 * k == x: +                ans += 1 +print(ans)