cnt500 = int(eval(input()))

cnt100 = int(eval(input()))

cnt50 = int(eval(input()))

X = int(eval(input()))



all_set = set([])



for a in range(cnt500+1):

    tmp500 = a*500

    if tmp500 > X:

        break

    all_set.add((tmp500, 0, 0))

    for b in range(cnt100+1):

        tmp100 = b*100

        if tmp100 > X:

            break

        all_set.add((tmp500, tmp100, 0))

        for c in range(cnt50+1):

            tmp50 = c*50

            if tmp50 > X:

                break

            all_set.add((tmp500, tmp100, tmp50))



all = []

for a in all_set:

    all.append(sum(a))

print((all.count(X)))
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()))
all_set = set([])
for a in range(cnt500 + 1):
    tmp500 = a * 500
    if tmp500 > X:
        break
    all_set.add((tmp500, 0, 0))
    for b in range(cnt100 + 1):
        tmp100 = b * 100
        if tmp100 > X:
            break
        all_set.add((tmp500, tmp100, 0))
        for c in range(cnt50 + 1):
            tmp50 = c * 50
            if tmp50 > X:
                break
            all_set.add((tmp500, tmp100, tmp50))
all = []
for a in all_set:
    all.append(sum(a))
print((all.count(X)))

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)))

-all_set = set([]) +all = [] -    tmp500 = a * 500 -    if tmp500 > X: -        break -    all_set.add((tmp500, 0, 0)) -        tmp100 = b * 100 -        if tmp100 > X: -            break -        all_set.add((tmp500, tmp100, 0)) -            tmp50 = c * 50 -            if tmp50 > X: -                break -            all_set.add((tmp500, tmp100, tmp50)) -all = [] -for a in all_set: -    all.append(sum(a)) +            all.append(a * 500 + b * 100 + c * 50)