
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
In an $n \times n$ grid of cells, two diagonally opposite corner cells are black, and the rest are white. What is the minimum number of white cells that need to be painted black so that, using transformations consisting of painting all cells in any row or any column the opposite color, it is possible to make all cells in the grid black?

Present the answer in LaTex format: \boxed{Your answer}
user