a,b,c,x=list(map(int,open(0).read().split()))

cnt=0

for i in range(a+1):

    for j in range(b+1):

        for k in range(c+1):

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

            if sum==x :

                cnt+=1

print(cnt)
a,b,c,x=[int(eval(input())) for _ in range(4)]

cnt=0

for i in range(a+1):

    total=0

    for j in range(b+1):

        k=(x-(500*i+100*j))//50

        if k<=c and k>=0 : 

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

            if total==x:cnt+=1

print(cnt)
a, b, c, x = list(map(int, open(0).read().split()))
cnt = 0
for i in range(a + 1):
    for j in range(b + 1):
        for k in range(c + 1):
            sum = 500 * i + 100 * j + 50 * k
            if sum == x:
                cnt += 1
print(cnt)

a, b, c, x = [int(eval(input())) for _ in range(4)]
cnt = 0
for i in range(a + 1):
    total = 0
    for j in range(b + 1):
        k = (x - (500 * i + 100 * j)) // 50
        if k <= c and k >= 0:
            total = 500 * i + 100 * j + 50 * k
            if total == x:
                cnt += 1
print(cnt)

-a, b, c, x = list(map(int, open(0).read().split())) +a, b, c, x = [int(eval(input())) for _ in range(4)] +    total = 0 -        for k in range(c + 1): -            sum = 500 * i + 100 * j + 50 * k -            if sum == x: +        k = (x - (500 * i + 100 * j)) // 50 +        if k <= c and k >= 0: +            total = 500 * i + 100 * j + 50 * k +            if total == x: