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 (a*500 + b*100 + c*50) == X:

                cnt+=1

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

B = int(eval(input()))

C = int(eval(input()))

X = int(eval(input()))



cnt = 0

for a in range(min([A,-(-X//500)])+1):

    _a = a*500

    for b in range(min([B,-(-X//100)])+1):

        _b = b*100 + _a

        if _b > X: break

        for c in range(min([C,-(-X//50)])+1):

            _c = c*50 + _b

            if _c > X: break

            if _c == X:

                cnt+=1

print(cnt)
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 (a * 500 + b * 100 + c * 50) == X:
                cnt += 1
print(cnt)

A = int(eval(input()))
B = int(eval(input()))
C = int(eval(input()))
X = int(eval(input()))
cnt = 0
for a in range(min([A, -(-X // 500)]) + 1):
    _a = a * 500
    for b in range(min([B, -(-X // 100)]) + 1):
        _b = b * 100 + _a
        if _b > X:
            break
        for c in range(min([C, -(-X // 50)]) + 1):
            _c = c * 50 + _b
            if _c > X:
                break
            if _c == X:
                cnt += 1
print(cnt)

-for a in range(A + 1): -    for b in range(B + 1): -        for c in range(C + 1): -            if (a * 500 + b * 100 + c * 50) == X: +for a in range(min([A, -(-X // 500)]) + 1): +    _a = a * 500 +    for b in range(min([B, -(-X // 100)]) + 1): +        _b = b * 100 + _a +        if _b > X: +            break +        for c in range(min([C, -(-X // 50)]) + 1): +            _c = c * 50 + _b +            if _c > X: +                break +            if _c == X: