a, b, c, x = [int(eval(input())) for i in range(4)]

g = (

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

    for i in range(a + 1)

    for j in range(b + 1)

    for k in range(c + 1)

)

print((sum(g)))

def main(a, b, c, x):



    def gen(coin, n_of_coins, x_parts):

        for x_part in x_parts:

            for i in range(n_of_coins + 1):

                new_x_part = x_part + coin * i

                if new_x_part <= x:

                    yield new_x_part



    x_maybe_iter = gen(50, c, gen(100, b, gen(500, a, [0])))

    patterns = sum(x_maybe == x for x_maybe in x_maybe_iter)

    return patterns





if __name__ == '__main__':

    a, b, c, x = [int(eval(input())) for _ in range(4)]

    print((main(a, b, c, x)))

a, b, c, x = [int(eval(input())) for i in range(4)]
g = (
    500 * i + 100 * j + 50 * k == x
    for i in range(a + 1)
    for j in range(b + 1)
    for k in range(c + 1)
)
print((sum(g)))

def main(a, b, c, x):
    def gen(coin, n_of_coins, x_parts):
        for x_part in x_parts:
            for i in range(n_of_coins + 1):
                new_x_part = x_part + coin * i
                if new_x_part <= x:
                    yield new_x_part

    x_maybe_iter = gen(50, c, gen(100, b, gen(500, a, [0])))
    patterns = sum(x_maybe == x for x_maybe in x_maybe_iter)
    return patterns


if __name__ == "__main__":
    a, b, c, x = [int(eval(input())) for _ in range(4)]
    print((main(a, b, c, x)))

-a, b, c, x = [int(eval(input())) for i in range(4)] -g = ( -    500 * i + 100 * j + 50 * k == x -    for i in range(a + 1) -    for j in range(b + 1) -    for k in range(c + 1) -) -print((sum(g))) +def main(a, b, c, x): +    def gen(coin, n_of_coins, x_parts): +        for x_part in x_parts: +            for i in range(n_of_coins + 1): +                new_x_part = x_part + coin * i +                if new_x_part <= x: +                    yield new_x_part + +    x_maybe_iter = gen(50, c, gen(100, b, gen(500, a, [0]))) +    patterns = sum(x_maybe == x for x_maybe in x_maybe_iter) +    return patterns + + +if __name__ == "__main__": +    a, b, c, x = [int(eval(input())) for _ in range(4)] +    print((main(a, b, c, x)))