a, b, c, x = list(map(int, [eval(input()) for i in range(4)]))

count = 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:

                count += 1

print(count)
a, b, c, x = list(map(int, [eval(input()) for i in range(4)]))

count = 0

for i in range(a + 1):

    if 500 * i == x:

        count += 1

        break

    elif 500 * i > x:

        break

    else:

        for j in range(b + 1):

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

                count += 1

                break

            elif 500 * i + 100 * j > x:

                break

            else:

                for k in range(c + 1):

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

                        count += 1

                        break

print(count)
a, b, c, x = list(map(int, [eval(input()) for i in range(4)]))
count = 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:
                count += 1
print(count)

a, b, c, x = list(map(int, [eval(input()) for i in range(4)]))
count = 0
for i in range(a + 1):
    if 500 * i == x:
        count += 1
        break
    elif 500 * i > x:
        break
    else:
        for j in range(b + 1):
            if 500 * i + 100 * j == x:
                count += 1
                break
            elif 500 * i + 100 * j > x:
                break
            else:
                for k in range(c + 1):
                    if 500 * i + 100 * j + 50 * k == x:
                        count += 1
                        break
print(count)

-    for j in range(b + 1): -        for k in range(c + 1): -            if 500 * i + 100 * j + 50 * k == x: +    if 500 * i == x: +        count += 1 +        break +    elif 500 * i > x: +        break +    else: +        for j in range(b + 1): +            if 500 * i + 100 * j == x: +                break +            elif 500 * i + 100 * j > x: +                break +            else: +                for k in range(c + 1): +                    if 500 * i + 100 * j + 50 * k == x: +                        count += 1 +                        break