def calculate(triangle):
    """Returns the maximum total from top to bottom by starting at the top
    of the specified triangle and moving to adjacent numbers on the row below"""

    def calculate_helper(row, col):
        """Returns the maximum path value of a specified cell in the triangle"""
        if row == len(triangle):
            return 0
        return triangle[row][col] + max(
            calculate_helper(row + 1, col), calculate_helper(row + 1, col + 1)
        )

    return calculate_helper(0, 0)