A=eval(input())

B=eval(input())

C=eval(input())

X=eval(input())

sum=0

for a in range(int(A)+1):

    for b in range(int(B)+1):

        for c in range(int(C)+1):

            if 500*a+100*b+50*c==int(X):

                sum+=1

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

b=int(eval(input()))

c=int(eval(input()))

x=int(eval(input()))

ans=0

for ai in range(a+1):

  for bi in range(b+1):

    for ci in range(c+1):

      y=500*ai+100*bi+50*ci

      if x == y:

        ans+=1

      if y>x:

        break

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

a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input()))
ans = 0
for ai in range(a + 1):
    for bi in range(b + 1):
        for ci in range(c + 1):
            y = 500 * ai + 100 * bi + 50 * ci
            if x == y:
                ans += 1
            if y > x:
                break
print(ans)

-A = eval(input()) -B = eval(input()) -C = eval(input()) -X = eval(input()) -sum = 0 -for a in range(int(A) + 1): -    for b in range(int(B) + 1): -        for c in range(int(C) + 1): -            if 500 * a + 100 * b + 50 * c == int(X): -                sum += 1 -print(sum) +a = int(eval(input())) +b = int(eval(input())) +c = int(eval(input())) +x = int(eval(input())) +ans = 0 +for ai in range(a + 1): +    for bi in range(b + 1): +        for ci in range(c + 1): +            y = 500 * ai + 100 * bi + 50 * ci +            if x == y: +                ans += 1 +            if y > x: +                break +print(ans)