A=int(eval(input()))

B=int(eval(input()))

C=int(eval(input()))

X=int(eval(input()))

a=0

b=0

c=0

count = 0

while a*500<=X and a<=A:

    while a*500+b*100<=X and b<=B:

        while a*500+b*100+c * 50 <=X and c<=C:

            if a*500+b*100+c*50==X:

                #print(a,b,c)

                count+=1

                break

            else:

                #print(a,a,b,c)

                c+=1

        c=0

        b+=1

        #print(b,c)

    a+=1

    b=0

    c=0

    #print(a,b,c)

print(count)

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()))
a = 0
b = 0
c = 0
count = 0
while a * 500 <= X and a <= A:
    while a * 500 + b * 100 <= X and b <= B:
        while a * 500 + b * 100 + c * 50 <= X and c <= C:
            if a * 500 + b * 100 + c * 50 == X:
                # print(a,b,c)
                count += 1
                break
            else:
                # print(a,a,b,c)
                c += 1
        c = 0
        b += 1
        # print(b,c)
    a += 1
    b = 0
    c = 0
    # print(a,b,c)
print(count)

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 = 0 -b = 0 -c = 0 -count = 0 -while a * 500 <= X and a <= A: -    while a * 500 + b * 100 <= X and b <= B: -        while a * 500 + b * 100 + c * 50 <= X and c <= C: -            if a * 500 + b * 100 + c * 50 == X: -                # print(a,b,c) -                count += 1 -                break -            else: -                # print(a,a,b,c) -                c += 1 -        c = 0 -        b += 1 -        # print(b,c) -    a += 1 -    b = 0 -    c = 0 -    # print(a,b,c) -print(count) +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)