coinA = int(eval(input()))

coinB = int(eval(input()))

coinC = int(eval(input()))

want = int(eval(input()))

ways = 0

i = 0

while i <= coinA:

    j = 0

    while j <= coinB:

        k = 0

        while k <= coinC:

            if i*500 + j*100 + k*50 == want:

                ways = ways + 1

            k = k + 1

        j = j + 1

    i = i + 1

print(ways)

a=int(input())

b=int(input())

c=int(input())

x=int(input())

op=0

for i in range(a+1):

	for j in range(b+1):

		for k in range(c+1):

			if 500*i+100*j+50*k==x:

				op=op+1

				

print(op)
coinA = int(eval(input()))
coinB = int(eval(input()))
coinC = int(eval(input()))
want = int(eval(input()))
ways = 0
i = 0
while i <= coinA:
    j = 0
    while j <= coinB:
        k = 0
        while k <= coinC:
            if i * 500 + j * 100 + k * 50 == want:
                ways = ways + 1
            k = k + 1
        j = j + 1
    i = i + 1
print(ways)

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

-coinA = int(eval(input())) -coinB = int(eval(input())) -coinC = int(eval(input())) -want = int(eval(input())) -ways = 0 -i = 0 -while i <= coinA: -    j = 0 -    while j <= coinB: -        k = 0 -        while k <= coinC: -            if i * 500 + j * 100 + k * 50 == want: -                ways = ways + 1 -            k = k + 1 -        j = j + 1 -    i = i + 1 -print(ways) +a = int(input()) +b = int(input()) +c = int(input()) +x = int(input()) +op = 0 +for i in range(a + 1): +    for j in range(b + 1): +        for k in range(c + 1): +            if 500 * i + 100 * j + 50 * k == x: +                op = op + 1 +print(op)