cnt500 = int(eval(input()))

cnt100 = int(eval(input()))

cnt50 = int(eval(input()))

X = int(eval(input()))



all = []

for a in range(cnt500+1):

    for b in range(cnt100+1):

        for c in range(cnt50+1):

            all.append(a*500 + b*100 + c*50)

print((all.count(X)))
cnt500 = int(eval(input()))

cnt100 = int(eval(input()))

cnt50 = int(eval(input()))

X = int(eval(input()))



result = 0

for a in range(cnt500+1):

    for b in range(cnt100+1):

        for c in range(cnt50+1):

           if (a*500 + b*100 + c*50) == X:

               result += 1

print(result)
cnt500 = int(eval(input()))
cnt100 = int(eval(input()))
cnt50 = int(eval(input()))
X = int(eval(input()))
all = []
for a in range(cnt500 + 1):
    for b in range(cnt100 + 1):
        for c in range(cnt50 + 1):
            all.append(a * 500 + b * 100 + c * 50)
print((all.count(X)))

cnt500 = int(eval(input()))
cnt100 = int(eval(input()))
cnt50 = int(eval(input()))
X = int(eval(input()))
result = 0
for a in range(cnt500 + 1):
    for b in range(cnt100 + 1):
        for c in range(cnt50 + 1):
            if (a * 500 + b * 100 + c * 50) == X:
                result += 1
print(result)

-all = [] +result = 0 -            all.append(a * 500 + b * 100 + c * 50) -print((all.count(X))) +            if (a * 500 + b * 100 + c * 50) == X: +                result += 1 +print(result)