a = int(eval(input()))

b = int(eval(input()))

c = int(eval(input()))

x = int(eval(input()))



cnt = 0

for i in range(a + 1):

	if 500 * i <= x:

		p = x - 500 * i

		for j in range(b + 1):

			if 100 * j <= p:

				q = p - 100 * j

				for k in range(c + 1):

					if q - 50 * k == 0:

						cnt += 1



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

b = int(eval(input()))

c = int(eval(input()))

x = int(eval(input()))



n = 0

for i in range(a + 1):

	for j in range(b + 1):

		k = (x - 500 * i - 100 * j) // 50

		if 0 <= k <= c:

			n += 1



print(n)
a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input()))
cnt = 0
for i in range(a + 1):
    if 500 * i <= x:
        p = x - 500 * i
        for j in range(b + 1):
            if 100 * j <= p:
                q = p - 100 * j
                for k in range(c + 1):
                    if q - 50 * k == 0:
                        cnt += 1
print(cnt)

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

-cnt = 0 +n = 0 -    if 500 * i <= x: -        p = x - 500 * i -        for j in range(b + 1): -            if 100 * j <= p: -                q = p - 100 * j -                for k in range(c + 1): -                    if q - 50 * k == 0: -                        cnt += 1 -print(cnt) +    for j in range(b + 1): +        k = (x - 500 * i - 100 * j) // 50 +        if 0 <= k <= c: +            n += 1 +print(n)