A = int(eval(input()))

B = int(eval(input()))

C = int(eval(input()))

X = int(eval(input()))



counter = 0

for i in range(0, A+1):

    for n in range(0, B+1):

        for t in range(0, C+1):

            total = 500 * i + 100 * n + 50 * t

            if total == X:

                counter += 1

print(counter)     
A = int(eval(input()))

B = int(eval(input()))

C = int(eval(input()))

X = int(eval(input()))



counter = 0

for i in range(0, A+1):

    ans = X - 500 * i

    if ans > 0:

        for n in range(0, B+1):

            ans1 = ans - 100 * n

            if ans1 > 0 and (ans1 / 50) <= C:

                counter += 1

            elif ans1 == 0:

                counter += 1

    elif ans == 0:

        counter += 1

print(counter) 
A = int(eval(input()))
B = int(eval(input()))
C = int(eval(input()))
X = int(eval(input()))
counter = 0
for i in range(0, A + 1):
    for n in range(0, B + 1):
        for t in range(0, C + 1):
            total = 500 * i + 100 * n + 50 * t
            if total == X:
                counter += 1
print(counter)

A = int(eval(input()))
B = int(eval(input()))
C = int(eval(input()))
X = int(eval(input()))
counter = 0
for i in range(0, A + 1):
    ans = X - 500 * i
    if ans > 0:
        for n in range(0, B + 1):
            ans1 = ans - 100 * n
            if ans1 > 0 and (ans1 / 50) <= C:
                counter += 1
            elif ans1 == 0:
                counter += 1
    elif ans == 0:
        counter += 1
print(counter)

-    for n in range(0, B + 1): -        for t in range(0, C + 1): -            total = 500 * i + 100 * n + 50 * t -            if total == X: +    ans = X - 500 * i +    if ans > 0: +        for n in range(0, B + 1): +            ans1 = ans - 100 * n +            if ans1 > 0 and (ans1 / 50) <= C: +            elif ans1 == 0: +                counter += 1 +    elif ans == 0: +        counter += 1