a = int(eval(input()))

b = int(eval(input()))

c = int(eval(input()))

x = int(eval(input()))/50



count = 0

for i in range(a+1):

 if 10*i>x: break

 for j in range(b+1):

  if 10*i+2*j>x: break

  for k in range(c+1):

   if 10*i+2*j+k == x:

    count += 1



print(count)

a = int(eval(input()))

b = int(eval(input()))

c = int(eval(input()))

x = int(eval(input()))



count = 0

for i in range(a+1):

 if 500*i>x: break

 for j in range(b+1):

  if 500*i+100*j > x: break

  if x-500*i-100*j <= 50*c:

   count += 1



print(count)
a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input())) / 50
count = 0
for i in range(a + 1):
    if 10 * i > x:
        break
    for j in range(b + 1):
        if 10 * i + 2 * j > x:
            break
        for k in range(c + 1):
            if 10 * i + 2 * j + k == x:
                count += 1
print(count)

a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input()))
count = 0
for i in range(a + 1):
    if 500 * i > x:
        break
    for j in range(b + 1):
        if 500 * i + 100 * j > x:
            break
        if x - 500 * i - 100 * j <= 50 * c:
            count += 1
print(count)

-x = int(eval(input())) / 50 +x = int(eval(input())) -    if 10 * i > x: +    if 500 * i > x: -        if 10 * i + 2 * j > x: +        if 500 * i + 100 * j > x: -        for k in range(c + 1): -            if 10 * i + 2 * j + k == x: -                count += 1 +        if x - 500 * i - 100 * j <= 50 * c: +            count += 1