

# ABC-087_B-Coins



A_num = int(eval(input()))

B_num = int(eval(input()))

C_num = int(eval(input()))

X_yen = int(eval(input()))

count = 0



for a in range(A_num+1):

    for b in range(B_num+1):

        for c in range(C_num+1):

            total = 500*a + 100*b + 50*c

            if total == X_yen:

                count += 1

print(count)
in_a = eval(input())

in_b = eval(input())

in_c = eval(input())

in_x = eval(input())



A = int(in_a)

B = int(in_b)

C = int(in_c)

X = int(in_x)



count = 0

for i in range(A+1):

    for j in range(B+1):

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

        # print(f'k：{k}')

        if k < 0:

            break;

        elif k.is_integer() and k <= C:

            count +=1

            # print('clear', k, count)



print(count)
# ABC-087_B-Coins
A_num = int(eval(input()))
B_num = int(eval(input()))
C_num = int(eval(input()))
X_yen = int(eval(input()))
count = 0
for a in range(A_num + 1):
    for b in range(B_num + 1):
        for c in range(C_num + 1):
            total = 500 * a + 100 * b + 50 * c
            if total == X_yen:
                count += 1
print(count)

in_a = eval(input())
in_b = eval(input())
in_c = eval(input())
in_x = eval(input())
A = int(in_a)
B = int(in_b)
C = int(in_c)
X = int(in_x)
count = 0
for i in range(A + 1):
    for j in range(B + 1):
        k = (X - 500 * i - 100 * j) / 50
        # print(f'k：{k}')
        if k < 0:
            break
        elif k.is_integer() and k <= C:
            count += 1
            # print('clear', k, count)
print(count)

-# ABC-087_B-Coins -A_num = int(eval(input())) -B_num = int(eval(input())) -C_num = int(eval(input())) -X_yen = int(eval(input())) +in_a = eval(input()) +in_b = eval(input()) +in_c = eval(input()) +in_x = eval(input()) +A = int(in_a) +B = int(in_b) +C = int(in_c) +X = int(in_x) -for a in range(A_num + 1): -    for b in range(B_num + 1): -        for c in range(C_num + 1): -            total = 500 * a + 100 * b + 50 * c -            if total == X_yen: -                count += 1 +for i in range(A + 1): +    for j in range(B + 1): +        k = (X - 500 * i - 100 * j) / 50 +        # print(f'k：{k}') +        if k < 0: +            break +        elif k.is_integer() and k <= C: +            count += 1 +            # print('clear', k, count)