cnt500 = int(eval(input()))

cnt100 = int(eval(input()))

cnt50 = int(eval(input()))

X = int(eval(input()))



all_set = set([])



for i,a in enumerate(range(cnt500+1)):

    tmp500 = i*500

    if tmp500 > X:

        break

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

    for i,b in enumerate(range(cnt100+1)):

        tmp100 = i*100

        if tmp100 > X:

            break

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

        for i,c in enumerate(range(cnt50+1)):

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

-for i, a in enumerate(range(cnt500 + 1)): -    tmp500 = i * 500 +for a in range(cnt500 + 1): +    tmp500 = a * 500 -    for i, b in enumerate(range(cnt100 + 1)): -        tmp100 = i * 100 +    for b in range(cnt100 + 1): +        tmp100 = b * 100 -        for i, c in enumerate(range(cnt50 + 1)): -            tmp50 = i * 50 +        for c in range(cnt50 + 1): +            tmp50 = c * 50