A = int (eval(input()))

B = int (eval(input()))

C = int (eval(input()))

X = int (eval(input()))



ans = 0



for x in range(A+1):

    for y in range(B+1):

        for z in range(C+1):

            if 500 * x + 100 * y + 50 * z == X:

                ans +=1



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

B = int(eval(input()))

C = int(eval(input()))

X = int(eval(input()))



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

                cnt+= 1



print(cnt)
A = int(eval(input()))
B = int(eval(input()))
C = int(eval(input()))
X = int(eval(input()))
ans = 0
for x in range(A + 1):
    for y in range(B + 1):
        for z in range(C + 1):
            if 500 * x + 100 * y + 50 * z == X:
                ans += 1
print(ans)

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

-ans = 0 -for x in range(A + 1): -    for y in range(B + 1): -        for z in range(C + 1): -            if 500 * x + 100 * y + 50 * z == X: -                ans += 1 -print(ans) +cnt = 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: +                cnt += 1 +print(cnt)