a, b, c, x = list(map(int, [eval(input()) for i in range(4)]))

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

                ans += 1

print(ans)
a, b, c, x = list(map(int, [eval(input()) for i in range(4)]))

ans = [ a for a1 in range(a+1) for b1 in range(b+1) for c1 in range(c+1) if a1*500 + b1*100+ c1*50 == x ]

print((len(ans)))
a, b, c, x = list(map(int, [eval(input()) for i in range(4)]))
ans = 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:
                ans += 1
print(ans)

a, b, c, x = list(map(int, [eval(input()) for i in range(4)]))
ans = [
    a
    for a1 in range(a + 1)
    for b1 in range(b + 1)
    for c1 in range(c + 1)
    if a1 * 500 + b1 * 100 + c1 * 50 == x
]
print((len(ans)))

-ans = 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: -                ans += 1 -print(ans) +ans = [ +    a +    for a1 in range(a + 1) +    for b1 in range(b + 1) +    for c1 in range(c + 1) +    if a1 * 500 + b1 * 100 + c1 * 50 == x +] +print((len(ans)))