a = int(eval(input())) # 500

b = int(eval(input())) # 100

c = int(eval(input())) # 50

x = int(eval(input()))



count = 0



for an in range(a+1):

    if 500 * an == x:

        count += 1

        break

    else:

        for bn in range(b+1):

            if 500 * an + 100 * bn == x:

                count += 1

                break

            else:

                for cn in range(c+1):

                    if 500 * an + 100 * bn + 50 * cn == x:

                        count += 1

                        break



print(count)

a = int(eval(input()))

b = int(eval(input()))

c = int(eval(input()))

x = int(eval(input()))



ans = 0

for count500 in range(a+1):

    for count100 in range(b+1):

        value = 500 * count500 + 100 * count100

        delta = x - value

        if delta < 0:

            break



        if delta % 50 == 0 and delta // 50 <= c:

            ans += 1



print(ans)
a = int(eval(input()))  # 500
b = int(eval(input()))  # 100
c = int(eval(input()))  # 50
x = int(eval(input()))
count = 0
for an in range(a + 1):
    if 500 * an == x:
        count += 1
        break
    else:
        for bn in range(b + 1):
            if 500 * an + 100 * bn == x:
                count += 1
                break
            else:
                for cn in range(c + 1):
                    if 500 * an + 100 * bn + 50 * cn == x:
                        count += 1
                        break
print(count)

a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input()))
ans = 0
for count500 in range(a + 1):
    for count100 in range(b + 1):
        value = 500 * count500 + 100 * count100
        delta = x - value
        if delta < 0:
            break
        if delta % 50 == 0 and delta // 50 <= c:
            ans += 1
print(ans)

-a = int(eval(input()))  # 500 -b = int(eval(input()))  # 100 -c = int(eval(input()))  # 50 +a = int(eval(input())) +b = int(eval(input())) +c = int(eval(input())) -count = 0 -for an in range(a + 1): -    if 500 * an == x: -        count += 1 -        break -    else: -        for bn in range(b + 1): -            if 500 * an + 100 * bn == x: -                count += 1 -                break -            else: -                for cn in range(c + 1): -                    if 500 * an + 100 * bn + 50 * cn == x: -                        count += 1 -                        break -print(count) +ans = 0 +for count500 in range(a + 1): +    for count100 in range(b + 1): +        value = 500 * count500 + 100 * count100 +        delta = x - value +        if delta < 0: +            break +        if delta % 50 == 0 and delta // 50 <= c: +            ans += 1 +print(ans)