a = int(eval(input()))

b = int(eval(input()))

c = int(eval(input()))

x = int(eval(input()))



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

                res += 1



print(res)

a = int(eval(input()))

b = int(eval(input()))

c = int(eval(input()))

x = int(eval(input()))



c_nums = set(50 * i for i in range(c + 1))

res = 0

for i in range(a + 1):

    for j in range(b + 1):

        tmp = x - 500 * i - 100 * j

        if tmp in c_nums:

            res += 1



print(res)

a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input()))
res = 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:
                res += 1
print(res)

a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input()))
c_nums = set(50 * i for i in range(c + 1))
res = 0
for i in range(a + 1):
    for j in range(b + 1):
        tmp = x - 500 * i - 100 * j
        if tmp in c_nums:
            res += 1
print(res)

+c_nums = set(50 * i for i in range(c + 1)) -        for k in range(c + 1): -            if 500 * i + 100 * j + 50 * k == x: -                res += 1 +        tmp = x - 500 * i - 100 * j +        if tmp in c_nums: +            res += 1