A, B, C, X = [int(input().rstrip()) for _ in range(4)]

count = 0



for a in range(A+1):

    sum_a = 500 * a

    for b in range(B+1):

        sum_b = 100 * b

        for c in range(C+1):

            sum_c = 50 * c

            total_sum = sum([sum_a, sum_b, sum_c])

            if total_sum == X:

                count += 1



print(count)

A, B, C, X = [int(input().rstrip()) for _ in range(4)]

count = 0



for a in range(A+1):

    sum_a = 500 * a

    for b in range(B+1):

        sum_b = 100 * b

        for c in range(C+1):

            sum_c = 50 * c

            sum_all = sum_a + sum_b + sum_c

            if sum_all == X:

                count += 1



print(count)

A, B, C, X = [int(input().rstrip()) for _ in range(4)]
count = 0
for a in range(A + 1):
    sum_a = 500 * a
    for b in range(B + 1):
        sum_b = 100 * b
        for c in range(C + 1):
            sum_c = 50 * c
            total_sum = sum([sum_a, sum_b, sum_c])
            if total_sum == X:
                count += 1
print(count)

A, B, C, X = [int(input().rstrip()) for _ in range(4)]
count = 0
for a in range(A + 1):
    sum_a = 500 * a
    for b in range(B + 1):
        sum_b = 100 * b
        for c in range(C + 1):
            sum_c = 50 * c
            sum_all = sum_a + sum_b + sum_c
            if sum_all == X:
                count += 1
print(count)

-            total_sum = sum([sum_a, sum_b, sum_c]) -            if total_sum == X: +            sum_all = sum_a + sum_b + sum_c +            if sum_all == X: