A=int(eval(input()))

B=int(eval(input()))

C=int(eval(input()))

X=int(eval(input()))



l=0

for a in range(A+1):

    ax = X - a*500

    for b in range(B+1):

        bx =ax - b*100

        for c in range(C+1):

            if bx - c*50 == 0:

                l+=1

print(l)

A=int(eval(input()))

B=int(eval(input()))

C=int(eval(input()))

X=int(eval(input()))



l=0

for a in range(A+1):

    ax = X - a*500

    for b in range(B+1):

        if C*50 + b*100 >= ax and ax - b*100 >=0:

            l+=1

print(l)

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

A = int(eval(input()))
B = int(eval(input()))
C = int(eval(input()))
X = int(eval(input()))
l = 0
for a in range(A + 1):
    ax = X - a * 500
    for b in range(B + 1):
        if C * 50 + b * 100 >= ax and ax - b * 100 >= 0:
            l += 1
print(l)

-        bx = ax - b * 100 -        for c in range(C + 1): -            if bx - c * 50 == 0: -                l += 1 +        if C * 50 + b * 100 >= ax and ax - b * 100 >= 0: +            l += 1