
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 a plane, there are \( n+4 \) points, four of which are located at the vertices of a square, and the remaining \( n \) lie inside this square. You are allowed to connect any of these points with segments, provided that no segment contains any of the marked points other than its endpoints, and no two segments share any points other than their endpoints. Find the maximum number of segments that can be constructed in this way.

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