A = int(eval(input()))

B = int(eval(input()))

C = int(eval(input()))

X = int(eval(input()))

L = []

answer = 0

for i in range(A+1) :

    for j in range(B+1) :

        for k in range(C+1) :

            L.append(500*i+100*j+50*k)

for l in range(len(L)) :

    if X-L[l] == 0 :

        answer += 1

print(answer)



A = int(eval(input()))

B = int(eval(input()))

C = int(eval(input()))

X = int(eval(input()))

ans = 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 :

                ans += 1

print(ans)

A = int(eval(input()))
B = int(eval(input()))
C = int(eval(input()))
X = int(eval(input()))
L = []
answer = 0
for i in range(A + 1):
    for j in range(B + 1):
        for k in range(C + 1):
            L.append(500 * i + 100 * j + 50 * k)
for l in range(len(L)):
    if X - L[l] == 0:
        answer += 1
print(answer)

A = int(eval(input()))
B = int(eval(input()))
C = int(eval(input()))
X = int(eval(input()))
ans = 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:
                ans += 1
print(ans)

-L = [] -answer = 0 -for i in range(A + 1): -    for j in range(B + 1): -        for k in range(C + 1): -            L.append(500 * i + 100 * j + 50 * k) -for l in range(len(L)): -    if X - L[l] == 0: -        answer += 1 -print(answer) +ans = 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: +                ans += 1 +print(ans)