a = int(eval(input())) 

b = int(eval(input())) 

c = int(eval(input())) 

x = int(eval(input()))

count = 0



for v_a in range(a+1):

    for v_b in range(b+1):

        for v_c in range(c+1):

            if v_a*500 + v_b*100 + v_c*50 == x:

                count += 1

print(count)
# B

a = int(eval(input()))

b = int(eval(input()))

c = int(eval(input()))

x = int(eval(input()))

count = 0

for i in range(a+1):

    for j in range(b+1):

        k = x - i*500 - j*100

        if k >= 0 and k // 50 <= c:

            count += 1

print(count)
a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input()))
count = 0
for v_a in range(a + 1):
    for v_b in range(b + 1):
        for v_c in range(c + 1):
            if v_a * 500 + v_b * 100 + v_c * 50 == x:
                count += 1
print(count)

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

+# B -for v_a in range(a + 1): -    for v_b in range(b + 1): -        for v_c in range(c + 1): -            if v_a * 500 + v_b * 100 + v_c * 50 == x: -                count += 1 +for i in range(a + 1): +    for j in range(b + 1): +        k = x - i * 500 - j * 100 +        if k >= 0 and k // 50 <= c: +            count += 1