a,b,c,x=list(map(int,open(0).read().split()))



total=0

for a_ in range(0,a+1):

  for b_ in range(0,b+1):

    for c_ in range(0,c+1):

      if 500*a_+b_*100+c_*50 == x:

        total+=1

        break

print(total)
a,b,c,x=list(map(int,open(0).read().split()))



total=0

for a_ in range(0,a+1):

  for b_ in range(0,b+1):

    y=x-a_*500-b_*100

    if y%50==0 and 0<=y//50<=c:

      total+=1

print(total)
a, b, c, x = list(map(int, open(0).read().split()))
total = 0
for a_ in range(0, a + 1):
    for b_ in range(0, b + 1):
        for c_ in range(0, c + 1):
            if 500 * a_ + b_ * 100 + c_ * 50 == x:
                total += 1
                break
print(total)

a, b, c, x = list(map(int, open(0).read().split()))
total = 0
for a_ in range(0, a + 1):
    for b_ in range(0, b + 1):
        y = x - a_ * 500 - b_ * 100
        if y % 50 == 0 and 0 <= y // 50 <= c:
            total += 1
print(total)

-        for c_ in range(0, c + 1): -            if 500 * a_ + b_ * 100 + c_ * 50 == x: -                total += 1 -                break +        y = x - a_ * 500 - b_ * 100 +        if y % 50 == 0 and 0 <= y // 50 <= c: +            total += 1