```python
def count_Squares(m, n):
    """
    Counts the total number of squares in an m x n rectangle.

    The number of squares is calculated by summing the possible squares of
    different sizes. For a rectangle of size m x n:
    - The number of 1x1 squares is m * n.
    - The number of 2x2 squares is (m-1) * (n-1).
    - The number of 3x3 squares is (m-2) * (n-2).
    - This continues until one of the dimensions becomes 1.

    The total is the sum: m*n + (m-1)*(n-1) + (m-2)*(n-2) + ...
    This loop calculates this sum iteratively until one dimension reaches 0.
    """
    total_squares = 0
    while m > 0 and n > 0:
        total_squares += m * n
        m -= 1
        n -= 1
    return total_squares

```