a, b, c, x = int(eval(input())), int(eval(input())), int(eval(input())), int(eval(input()))

ans = 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):

                ans += 1

                break

            elif(500*i + 100*j + 50*k > x):

                break

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

ans = 0

for i in range(a+1):

    if(500*i > x):

        break

    for j in range(b+1):

        if(x - 500*i - 100*j >= 0 and (x - 500*i - 100*j) / 50 <= c):

            ans += 1

print(ans)
a, b, c, x = (
    int(eval(input())),
    int(eval(input())),
    int(eval(input())),
    int(eval(input())),
)
ans = 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:
                ans += 1
                break
            elif 500 * i + 100 * j + 50 * k > x:
                break
print(ans)

a, b, c, x = (
    int(eval(input())),
    int(eval(input())),
    int(eval(input())),
    int(eval(input())),
)
ans = 0
for i in range(a + 1):
    if 500 * i > x:
        break
    for j in range(b + 1):
        if x - 500 * i - 100 * j >= 0 and (x - 500 * i - 100 * j) / 50 <= c:
            ans += 1
print(ans)

+    if 500 * i > x: +        break -        for k in range(c + 1): -            if 500 * i + 100 * j + 50 * k == x: -                ans += 1 -                break -            elif 500 * i + 100 * j + 50 * k > x: -                break +        if x - 500 * i - 100 * j >= 0 and (x - 500 * i - 100 * j) / 50 <= c: +            ans += 1