a = int(eval(input()))

b = int(eval(input()))

c = int(eval(input()))

x = int(eval(input()))



bb = b

cc = c



cnt = 0

 

while a > -1:

    b = bb

    while b > -1:

        c = cc

        while c > -1:

            if (500 * a + 100 * b + 50 * c) == x:

                cnt += 1

            c -= 1

        b -= 1

    a -= 1



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

b = int(eval(input()))

c = int(eval(input()))

x = int(eval(input()))

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

                cnt += 1



print(cnt)
a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input()))
bb = b
cc = c
cnt = 0
while a > -1:
    b = bb
    while b > -1:
        c = cc
        while c > -1:
            if (500 * a + 100 * b + 50 * c) == x:
                cnt += 1
            c -= 1
        b -= 1
    a -= 1
print(cnt)

a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input()))
cnt = 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:
                cnt += 1
print(cnt)

-bb = b -cc = c -while a > -1: -    b = bb -    while b > -1: -        c = cc -        while c > -1: -            if (500 * a + 100 * b + 50 * c) == x: +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: -            c -= 1 -        b -= 1 -    a -= 1