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()))

cnt = 0



for i in range(a+1):

    for j in range(b+1):

        z = x-(500*i+100*j)

        if(z < 0):

            break

        if(z/50 <= c):

            cnt += 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()))
cnt = 0
for i in range(a + 1):
    for j in range(b + 1):
        z = x - (500 * i + 100 * j)
        if z < 0:
            break
        if z / 50 <= c:
            cnt += 1
print(cnt)

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