A, B, C, X = list(map(int, open(0).read().split()))



count=0

for i in range(A+1):

  for j in range(B+1):

    for k in range(C+1):

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

        count+=1



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

b=int(eval(input()))

c=int(eval(input()))

x=int(eval(input()))

ans=0

for i in range(a+1):

  A=500*i

  if A>x:

    break

  for j in range(b+1):

    B=100*j

    k = (x - A - B)/50

    if 0<=k<=c and k%1==0:

      ans+=1

print(ans)
A, B, C, X = list(map(int, open(0).read().split()))
count = 0
for i in range(A + 1):
    for j in range(B + 1):
        for k in range(C + 1):
            if 500 * i + 100 * j + 50 * k == X:
                count += 1
print(count)

a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input()))
ans = 0
for i in range(a + 1):
    A = 500 * i
    if A > x:
        break
    for j in range(b + 1):
        B = 100 * j
        k = (x - A - B) / 50
        if 0 <= k <= c and k % 1 == 0:
            ans += 1
print(ans)

-A, B, C, X = list(map(int, open(0).read().split())) -count = 0 -for i in range(A + 1): -    for j in range(B + 1): -        for k in range(C + 1): -            if 500 * i + 100 * j + 50 * k == X: -                count += 1 -print(count) +a = int(eval(input())) +b = int(eval(input())) +c = int(eval(input())) +x = int(eval(input())) +ans = 0 +for i in range(a + 1): +    A = 500 * i +    if A > x: +        break +    for j in range(b + 1): +        B = 100 * j +        k = (x - A - B) / 50 +        if 0 <= k <= c and k % 1 == 0: +            ans += 1 +print(ans)