A = int(eval(input()))

B = int(eval(input()))

C = int(eval(input()))

X = int(eval(input()))

ans = []





for i in range(A + 1):

    for j in range(B + 1):

        for k in range(C + 1):

            ans.append(500 * i + 100 * j + 50 * k)



print((ans.count(X)))
A = int(eval(input()))

B = int(eval(input()))

C = int(eval(input()))

X = int(eval(input()))

ans = 0





for i in range(A + 1):

    for j in range(B + 1):

        temp = X - (500 * i + 100 * j)

        if temp // 50 > C or temp < 0:

            continue

        else:

            ans += 1



print(ans)
A = int(eval(input()))
B = int(eval(input()))
C = int(eval(input()))
X = int(eval(input()))
ans = []
for i in range(A + 1):
    for j in range(B + 1):
        for k in range(C + 1):
            ans.append(500 * i + 100 * j + 50 * k)
print((ans.count(X)))

A = int(eval(input()))
B = int(eval(input()))
C = int(eval(input()))
X = int(eval(input()))
ans = 0
for i in range(A + 1):
    for j in range(B + 1):
        temp = X - (500 * i + 100 * j)
        if temp // 50 > C or temp < 0:
            continue
        else:
            ans += 1
print(ans)

-ans = [] +ans = 0 -        for k in range(C + 1): -            ans.append(500 * i + 100 * j + 50 * k) -print((ans.count(X))) +        temp = X - (500 * i + 100 * j) +        if temp // 50 > C or temp < 0: +            continue +        else: +            ans += 1 +print(ans)