If a square is partitioned into $ n$ convex polygons, determine the maximum possible number of edges in the obtained figure. 

(You may wish to use the following theorem of Euler: If a polygon is partitioned into $ n$ polygons with $ v$ vertices and $ e$ edges in the resulting figure, then $ v\minus{}e\plus{}n\equal{}1$.)
1. **Understanding the Problem:**
   We need to determine the maximum possible number of edges when a square is partitioned into \( n \) convex polygons. We will use Euler's formula for planar graphs: 
   \[
   v - e + f = 2
   \]
   where \( v \) is the number of vertices, \( e \) is the number of edges, and \( f \) is the number of faces. In our case, \( f = n + 1 \) because there are \( n \) interior faces (polygons) and 1 exterior face (the square itself).

2. **Graph Interpretation:**
   Consider the vertices and edges of the polygons as a graph. Each vertex in this graph corresponds to a vertex of one of the polygons, and each edge corresponds to a side of one of the polygons.

3. **Degree of Vertices:**
   - Each non-corner vertex has a degree of at least 2.
   - An edge vertex (not a corner) must have a degree of at least 3 because if it had a degree of 2, it would not form a valid polygon.
   - An interior vertex must have a degree of at least 3 since the total angle around it is 360 degrees, and each angle must be less than 180 degrees.

4. **Inequality for Edges and Vertices:**
   Since there are only 4 corner vertices, we can write:
   \[
   2e \geq 3v - 4
   \]
   This is because each edge contributes to the degree of two vertices, and there are at least \( 3v - 4 \) degrees to be distributed among the vertices.

5. **Using Euler's Formula:**
   From Euler's formula for planar graphs:
   \[
   v - e + (n + 1) = 2 \implies v - e + n + 1 = 2 \implies v - e + n = 1 \implies e = v + n - 1
   \]
   Substituting this into the inequality:
   \[
   2e = 2(v + n - 1) = 2v + 2n - 2
   \]
   We also have:
   \[
   2e \geq 3v - 4
   \]
   Therefore:
   \[
   2v + 2n - 2 \geq 3v - 4 \implies 2n - 2 \geq v - 4 \implies v \leq 2n + 2
   \]

6. **Maximum Number of Edges:**
   Using \( e = v + n - 1 \) and substituting \( v \leq 2n + 2 \):
   \[
   e \leq (2n + 2) + n - 1 = 3n + 1
   \]

Thus, the maximum possible number of edges when a square is partitioned into \( n \) convex polygons is \( 3n + 1 \).

The final answer is \( \boxed{ 3n + 1 } \).