A = int(eval(input()))

B = int(eval(input()))

C = int(eval(input()))

X = int(eval(input()))



out_sum = 0

cnt = 0



for i in range(A + 1):

    for j in range(B + 1):

        for k in range(C + 1):

            out_sum = i * 500 + j * 100 + k * 50

            if out_sum == X : cnt += 1

                

                

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

b = int(eval(input()))    #100

c = int(eval(input()))    #50

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()))
out_sum = 0
cnt = 0
for i in range(A + 1):
    for j in range(B + 1):
        for k in range(C + 1):
            out_sum = i * 500 + j * 100 + k * 50
            if out_sum == X:
                cnt += 1
print(cnt)

a = int(eval(input()))  # 500
b = int(eval(input()))  # 100
c = int(eval(input()))  # 50
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())) -out_sum = 0 +a = int(eval(input()))  # 500 +b = int(eval(input()))  # 100 +c = int(eval(input()))  # 50 +x = int(eval(input())) -for i in range(A + 1): -    for j in range(B + 1): -        for k in range(C + 1): -            out_sum = i * 500 + j * 100 + k * 50 -            if out_sum == X: +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: