a,b,c,x=list(map(int,open(0)));d=0

for i in range(a+1):

	for j in range(b+1):

		for k in range(c+1):

				d+=i*500+j*100+k*50==x

print(d)
a,b,c,x=list(map(int,open(0)))

print((sum(500*i+100*j+50*k==x for i in range(a+1)for j in range(b+1)for k in range(c+1))))
a, b, c, x = list(map(int, open(0)))
d = 0
for i in range(a + 1):
    for j in range(b + 1):
        for k in range(c + 1):
            d += i * 500 + j * 100 + k * 50 == x
print(d)

a, b, c, x = list(map(int, open(0)))
print(
    (
        sum(
            500 * i + 100 * j + 50 * k == x
            for i in range(a + 1)
            for j in range(b + 1)
            for k in range(c + 1)
        )
    )
)

-d = 0 -for i in range(a + 1): -    for j in range(b + 1): -        for k in range(c + 1): -            d += i * 500 + j * 100 + k * 50 == x -print(d) +print( +    ( +        sum( +            500 * i + 100 * j + 50 * k == x +            for i in range(a + 1) +            for j in range(b + 1) +            for k in range(c + 1) +        ) +    ) +)