# -*- coding: utf-8 -*-



a = int(eval(input())) # 500

b = int(eval(input())) # 100

c = int(eval(input())) # 50

x = int(eval(input()))



ans = 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:

                ans += 1



print(ans)

a = int(eval(input())) # 500

b = int(eval(input())) # 100

c = int(eval(input())) #  50

x = int(eval(input()))



ans = 0



for i in range(a+1):

    I = i*500

    for j in range(b+1):

        J = j*100

        for k in range(c+1):

            K = k*50

            if I+J+K == x:

                ans +=1



print(ans)

# -*- coding: utf-8 -*-
a = int(eval(input()))  # 500
b = int(eval(input()))  # 100
c = int(eval(input()))  # 50
x = int(eval(input()))
ans = 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:
                ans += 1
print(ans)

a = int(eval(input()))  # 500
b = int(eval(input()))  # 100
c = int(eval(input()))  #  50
x = int(eval(input()))
ans = 0
for i in range(a + 1):
    I = i * 500
    for j in range(b + 1):
        J = j * 100
        for k in range(c + 1):
            K = k * 50
            if I + J + K == x:
                ans += 1
print(ans)

-# -*- coding: utf-8 -*- -c = int(eval(input()))  # 50 +c = int(eval(input()))  #  50 +    I = i * 500 +        J = j * 100 -            if 500 * i + 100 * j + 50 * k == x: +            K = k * 50 +            if I + J + K == x: