A = int(eval(input()))

B = int(eval(input()))

C = int(eval(input()))

X = int(eval(input()))



cnt = 0



for num_A in [num_A for num_A in range(A + 1) if (num_A * 500 <= X)]:

    rest_XA = X - num_A * 500

    for num_B in [num_B for num_B in range(B + 1) if num_B * 100 <= rest_XA]:

        rest_XAB = rest_XA - num_B * 100

        if rest_XAB % 50 == 0 and rest_XAB <= C * 50:

            cnt += 1

print(cnt)

A = int(eval(input()))

B = int(eval(input()))

C = int(eval(input()))

X = int(eval(input()))



cnt = 0



for a in range(A + 1):

    for b in range(B + 1):

        for c in range(C + 1):

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

                cnt += 1



print(cnt)

A = int(eval(input()))
B = int(eval(input()))
C = int(eval(input()))
X = int(eval(input()))
cnt = 0
for num_A in [num_A for num_A in range(A + 1) if (num_A * 500 <= X)]:
    rest_XA = X - num_A * 500
    for num_B in [num_B for num_B in range(B + 1) if num_B * 100 <= rest_XA]:
        rest_XAB = rest_XA - num_B * 100
        if rest_XAB % 50 == 0 and rest_XAB <= C * 50:
            cnt += 1
print(cnt)

A = int(eval(input()))
B = int(eval(input()))
C = int(eval(input()))
X = int(eval(input()))
cnt = 0
for a in range(A + 1):
    for b in range(B + 1):
        for c in range(C + 1):
            if 500 * a + 100 * b + 50 * c == X:
                cnt += 1
print(cnt)

-for num_A in [num_A for num_A in range(A + 1) if (num_A * 500 <= X)]: -    rest_XA = X - num_A * 500 -    for num_B in [num_B for num_B in range(B + 1) if num_B * 100 <= rest_XA]: -        rest_XAB = rest_XA - num_B * 100 -        if rest_XAB % 50 == 0 and rest_XAB <= C * 50: -            cnt += 1 +for a in range(A + 1): +    for b in range(B + 1): +        for c in range(C + 1): +            if 500 * a + 100 * b + 50 * c == X: +                cnt += 1