a = int(eval(input()))

b = int(eval(input()))

c = int(eval(input()))

x = int(eval(input()))

res = 0



for i in range(a+1):

    for j in range(b+1):

        for k in range(c+1):

                total = i*500 + j*100 + k*50

                if total == x:

                    res += 1



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

b = int(eval(input()))

c = int(eval(input()))

x = 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



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

a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = 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
print(ans)

-res = 0 +ans = 0 -            total = i * 500 + j * 100 + k * 50 -            if total == x: -                res += 1 -print(res) +            if 500 * i + 100 * j + 50 * k == x: +                ans += 1 +print(ans)