def check_money(a, b, c, total, results):

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

        check = str(a) + ',' + str(b) + ',' + str(c)

        for result in results:

            if check in result:

                break

        else:

            results.append(check)

        return results

    else:

        return results





def main():

    coin_a = int(eval(input()))

    coin_b = int(eval(input()))

    coin_c = int(eval(input()))

    total_money = int(eval(input()))

    result = list()



    for coin_a_count in range(coin_a+1):

        if coin_a_count <= coin_a:

            for coin_b_count in range(coin_b+1):

                if coin_b_count <= coin_b:

                    for coin_c_count in range(coin_c+1):

                        if coin_c_count <= coin_c:

                            result = check_money(coin_a_count, coin_b_count, coin_c_count, total_money, result)



    print((result.__len__()))





if __name__ == '__main__':

    main()

def main():

    coin_a = int(eval(input()))

    coin_b = int(eval(input()))

    coin_c = int(eval(input()))

    total_money = int(eval(input()))

    result_count = 0



    for i in range(coin_a+1):

        for j in range(coin_b+1):

            for k in range(coin_c+1):

                if i * 500 + j * 100 + k * 50 == total_money:

                    result_count += 1



    print(result_count)





if __name__ == '__main__':

    main()

def check_money(a, b, c, total, results):
    if a * 500 + b * 100 + c * 50 == total:
        check = str(a) + "," + str(b) + "," + str(c)
        for result in results:
            if check in result:
                break
        else:
            results.append(check)
        return results
    else:
        return results


def main():
    coin_a = int(eval(input()))
    coin_b = int(eval(input()))
    coin_c = int(eval(input()))
    total_money = int(eval(input()))
    result = list()
    for coin_a_count in range(coin_a + 1):
        if coin_a_count <= coin_a:
            for coin_b_count in range(coin_b + 1):
                if coin_b_count <= coin_b:
                    for coin_c_count in range(coin_c + 1):
                        if coin_c_count <= coin_c:
                            result = check_money(
                                coin_a_count,
                                coin_b_count,
                                coin_c_count,
                                total_money,
                                result,
                            )
    print((result.__len__()))


if __name__ == "__main__":
    main()

def main():
    coin_a = int(eval(input()))
    coin_b = int(eval(input()))
    coin_c = int(eval(input()))
    total_money = int(eval(input()))
    result_count = 0
    for i in range(coin_a + 1):
        for j in range(coin_b + 1):
            for k in range(coin_c + 1):
                if i * 500 + j * 100 + k * 50 == total_money:
                    result_count += 1
    print(result_count)


if __name__ == "__main__":
    main()

-def check_money(a, b, c, total, results): -    if a * 500 + b * 100 + c * 50 == total: -        check = str(a) + "," + str(b) + "," + str(c) -        for result in results: -            if check in result: -                break -        else: -            results.append(check) -        return results -    else: -        return results - - -    result = list() -    for coin_a_count in range(coin_a + 1): -        if coin_a_count <= coin_a: -            for coin_b_count in range(coin_b + 1): -                if coin_b_count <= coin_b: -                    for coin_c_count in range(coin_c + 1): -                        if coin_c_count <= coin_c: -                            result = check_money( -                                coin_a_count, -                                coin_b_count, -                                coin_c_count, -                                total_money, -                                result, -                            ) -    print((result.__len__())) +    result_count = 0 +    for i in range(coin_a + 1): +        for j in range(coin_b + 1): +            for k in range(coin_c + 1): +                if i * 500 + j * 100 + k * 50 == total_money: +                    result_count += 1 +    print(result_count)