fh = int(eval(input()))

oh = int(eval(input()))

ft = int(eval(input()))

om = int(eval(input()))

count = 0



for i in range(fh + 1):

    for j in range(oh + 1):

        for k in range(ft + 1):

            nm = 0

            nm = i * 500 + j * 100 + k * 50

            if om == nm:

                count +=1



print(count)


fh = int(eval(input()))

oh = int(eval(input()))

ft = int(eval(input()))

om = int(eval(input()))

count = 0



for i in range(fh + 1):

    if om < i * 500:

        break

    for j in range(oh + 1):

        if om < i * 500 + j * 100:

            break

        for k in range(ft + 1):

            nm = 0

            nm = i * 500 + j * 100 + k * 50

            if om == nm:

                count +=1



print(count)
fh = int(eval(input()))
oh = int(eval(input()))
ft = int(eval(input()))
om = int(eval(input()))
count = 0
for i in range(fh + 1):
    for j in range(oh + 1):
        for k in range(ft + 1):
            nm = 0
            nm = i * 500 + j * 100 + k * 50
            if om == nm:
                count += 1
print(count)

fh = int(eval(input()))
oh = int(eval(input()))
ft = int(eval(input()))
om = int(eval(input()))
count = 0
for i in range(fh + 1):
    if om < i * 500:
        break
    for j in range(oh + 1):
        if om < i * 500 + j * 100:
            break
        for k in range(ft + 1):
            nm = 0
            nm = i * 500 + j * 100 + k * 50
            if om == nm:
                count += 1
print(count)

+    if om < i * 500: +        break +        if om < i * 500 + j * 100: +            break