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



A = 0

for i in range(a + 1):

    for j in range(b + 1):

        for k in range(c + 1):

            if i*500 + j*100 + k*50 == X:

                A += 1

print(A)

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

ans=0

for a0 in range(a+1):

  for b0 in range(b+1):

    for c0 in range(c+1):

      if (a0*500)+(b0*100)+(c0*50) == x:

        ans+=1

print(ans)
a, b, c, X = [int(eval(input())) for i in range(4)]
A = 0
for i in range(a + 1):
    for j in range(b + 1):
        for k in range(c + 1):
            if i * 500 + j * 100 + k * 50 == X:
                A += 1
print(A)

a, b, c, x = [int(eval(input())) for i in range(4)]
ans = 0
for a0 in range(a + 1):
    for b0 in range(b + 1):
        for c0 in range(c + 1):
            if (a0 * 500) + (b0 * 100) + (c0 * 50) == x:
                ans += 1
print(ans)

-a, b, c, X = [int(eval(input())) for i in range(4)] -A = 0 -for i in range(a + 1): -    for j in range(b + 1): -        for k in range(c + 1): -            if i * 500 + j * 100 + k * 50 == X: -                A += 1 -print(A) +a, b, c, x = [int(eval(input())) for i in range(4)] +ans = 0 +for a0 in range(a + 1): +    for b0 in range(b + 1): +        for c0 in range(c + 1): +            if (a0 * 500) + (b0 * 100) + (c0 * 50) == x: +                ans += 1 +print(ans)