A, B, C, X = list(map(int, [eval(input()) for _ in range(4)]))



count = 0

for a in range(A + 1):

	for b in range(B + 1):

		for c in range(C + 1):

			value = 500 * a + 100 * b + 50 * c

			if X == value:

				count += 1

print(count)
A, B, C, X = list(map(int, [eval(input()) for _ in range(4)]))



count = 0

for a in range(A + 1):

	for b in range(B + 1):

		value = 500 * a + 100 * b

		#print(value)

		if value <= X and (X - value) // 50 <= C:

			count += 1

print(count)
A, B, C, X = list(map(int, [eval(input()) for _ in range(4)]))
count = 0
for a in range(A + 1):
    for b in range(B + 1):
        for c in range(C + 1):
            value = 500 * a + 100 * b + 50 * c
            if X == value:
                count += 1
print(count)

A, B, C, X = list(map(int, [eval(input()) for _ in range(4)]))
count = 0
for a in range(A + 1):
    for b in range(B + 1):
        value = 500 * a + 100 * b
        # print(value)
        if value <= X and (X - value) // 50 <= C:
            count += 1
print(count)

-        for c in range(C + 1): -            value = 500 * a + 100 * b + 50 * c -            if X == value: -                count += 1 +        value = 500 * a + 100 * b +        # print(value) +        if value <= X and (X - value) // 50 <= C: +            count += 1