a = int(eval(input()))

b = int(eval(input()))

c = int(eval(input()))

x = int(eval(input()))



l = 0



def pattern(a, b, c, x):

	if x == 0:

		return 1

	else:

		if (x >= 500) and (a >= 1):

			return pattern(a - 1, b, c, x - 500) + pattern(0, b, c, x)

		elif (x >= 100) and (b >= 1):

			return pattern(a, b - 1, c, x - 100) + pattern(a, 0, c, x)

		elif (x >= 50) and (c >= 1):

			return pattern(a, b, c - 1, x - 50) + pattern(a, b, 0, x)

		else:

			return 0



ans = pattern(a, b, c, x)



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

b = int(eval(input()))

c = int(eval(input()))

x = int(eval(input()))



l = 0



def pattern(a, b, c, x):

	if x == 0:

		return 1

	else:

		if (500 * a + 100 * b + 50 * c < x):

			return 0

		elif (x >= 500) and (a >= 1):

			return pattern(a - 1, b, c, x - 500) + pattern(0, b, c, x)

		elif (x >= 100) and (b >= 1):

			return pattern(a, b - 1, c, x - 100) + pattern(a, 0, c, x)

		elif (x >= 50) and (c >= 1):

			return pattern(a, b, c - 1, x - 50) + pattern(a, b, 0, x)

		else:

			return 0



ans = pattern(a, b, c, x)



print(ans)
a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input()))
l = 0


def pattern(a, b, c, x):
    if x == 0:
        return 1
    else:
        if (x >= 500) and (a >= 1):
            return pattern(a - 1, b, c, x - 500) + pattern(0, b, c, x)
        elif (x >= 100) and (b >= 1):
            return pattern(a, b - 1, c, x - 100) + pattern(a, 0, c, x)
        elif (x >= 50) and (c >= 1):
            return pattern(a, b, c - 1, x - 50) + pattern(a, b, 0, x)
        else:
            return 0


ans = pattern(a, b, c, x)
print(ans)

a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input()))
l = 0


def pattern(a, b, c, x):
    if x == 0:
        return 1
    else:
        if 500 * a + 100 * b + 50 * c < x:
            return 0
        elif (x >= 500) and (a >= 1):
            return pattern(a - 1, b, c, x - 500) + pattern(0, b, c, x)
        elif (x >= 100) and (b >= 1):
            return pattern(a, b - 1, c, x - 100) + pattern(a, 0, c, x)
        elif (x >= 50) and (c >= 1):
            return pattern(a, b, c - 1, x - 50) + pattern(a, b, 0, x)
        else:
            return 0


ans = pattern(a, b, c, x)
print(ans)

-        if (x >= 500) and (a >= 1): +        if 500 * a + 100 * b + 50 * c < x: +            return 0 +        elif (x >= 500) and (a >= 1):