A = int(eval(input()))

B = int(eval(input()))

C = int(eval(input()))

X = int(eval(input()))



ans = 0

for count_500 in range(A+1):

    for count_100 in range(B+1):

        for count_50 in range(C+1):

            sum_money = 500*count_500 + 100*count_100 + 50*count_50

            if sum_money == X:

                ans += 1

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

B = int(eval(input()))

C = int(eval(input()))

X = int(eval(input()))

count = 0

for i1 in range(A+1):

    for i2 in range(B+1):

        for i3 in range(C+1):

            if (i1*500 + i2*100 + i3 *50) == X:

                count += 1

print(count)
A = int(eval(input()))
B = int(eval(input()))
C = int(eval(input()))
X = int(eval(input()))
ans = 0
for count_500 in range(A + 1):
    for count_100 in range(B + 1):
        for count_50 in range(C + 1):
            sum_money = 500 * count_500 + 100 * count_100 + 50 * count_50
            if sum_money == X:
                ans += 1
print(ans)

A = int(eval(input()))
B = int(eval(input()))
C = int(eval(input()))
X = int(eval(input()))
count = 0
for i1 in range(A + 1):
    for i2 in range(B + 1):
        for i3 in range(C + 1):
            if (i1 * 500 + i2 * 100 + i3 * 50) == X:
                count += 1
print(count)

-ans = 0 -for count_500 in range(A + 1): -    for count_100 in range(B + 1): -        for count_50 in range(C + 1): -            sum_money = 500 * count_500 + 100 * count_100 + 50 * count_50 -            if sum_money == X: -                ans += 1 -print(ans) +count = 0 +for i1 in range(A + 1): +    for i2 in range(B + 1): +        for i3 in range(C + 1): +            if (i1 * 500 + i2 * 100 + i3 * 50) == X: +                count += 1 +print(count)