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 500 * A + 100 * B + 50 * C == x:

        ans += 1

print(ans)
a = int(eval(input()))

b = int(eval(input()))

c = int(eval(input()))

x = int(eval(input()))

ans = 0

for A in range(a + 1):

    for B in range(b + 1):

        C = (x - 500 * A - 100 * B) // 50

        if 0 <= C <= c:

            ans += 1

print(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 500 * A + 100 * B + 50 * C == x:
                ans += 1
print(ans)

a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input()))
ans = 0
for A in range(a + 1):
    for B in range(b + 1):
        C = (x - 500 * A - 100 * B) // 50
        if 0 <= C <= c:
            ans += 1
print(ans)

-a, b, c, x = list(map(int, [eval(input()) for i in range(4)])) +a = int(eval(input())) +b = int(eval(input())) +c = int(eval(input())) +x = int(eval(input())) -        for C in range(c + 1): -            if 500 * A + 100 * B + 50 * C == x: -                ans += 1 +        C = (x - 500 * A - 100 * B) // 50 +        if 0 <= C <= c: +            ans += 1