```python
def max_sum(tri, n):
    """
    Finds the maximum total from top to bottom in a right triangle of numbers.
    This function modifies the triangle in-place.
    """
    # Iterate from the second to last row up to the top row.
    for i in range(n - 2, -1, -1):
        # Iterate through each element in the current row.
        for j in range(i + 1):
            # Update the current element with the sum of itself and the
            # maximum of the two elements directly below it.
            tri[i][j] += max(tri[i + 1][j], tri[i + 1][j + 1])
    
    # The top element of the triangle will contain the maximum path sum.
    # This handles n=1 case as the loops won't execute.
    # Assumes n >= 1.
    return tri[0][0]

```