Let $n \geq 2$ be a positive integer. A total of $2n$ balls are coloured with $n$ colours so that there are two balls of each colour. These balls are put inside $n$ cylindrical boxes with two balls in each box, one on top of the other. Phoe Wa Lone has an empty cylindrical box and his goal is to sort the balls so that balls of the same colour are grouped together in each box. In a [i]move[/i], Phoe Wa Lone can do one of the following:
[list]
[*]Select a box containing exactly two balls and reverse the order of the top and the bottom balls.
[*]Take a ball $b$ at the top of a non-empty box and either put it in an empty box, or put it in the box only containing the ball of the same colour as $b$.
[/list]
Find the smallest positive integer $N$ such that for any initial placement of the balls, Phoe Wa Lone can always achieve his goal using at most $N$ moves in total.
To solve the problem, we need to determine the smallest positive integer \( N \) such that for any initial placement of the balls, Phoe Wa Lone can always achieve his goal using at most \( N \) moves in total. We will use a combination of combinatorial arguments and induction to find this value.

1. **Base Case Analysis:**
   - For \( n = 1 \), there is only one box with two balls of the same color. No moves are needed, so \( N = 0 \).
   - For \( n = 2 \), there are two boxes, each containing two balls of different colors. It takes one move to swap the balls between the boxes, so \( N = 1 \).

2. **General Case Analysis:**
   - Consider \( n \geq 3 \). We need to analyze the worst-case scenario where the balls are initially placed in such a way that achieving the goal requires the maximum number of moves.

3. **Graph Representation:**
   - Represent the problem as a graph where each box is a vertex and an edge exists between two vertices if they share a ball of the same color. This graph consists of disjoint cycles.

4. **Cycle Analysis:**
   - If the graph has more than one cycle, we can resolve each cycle separately using the induction hypothesis. This gives us a bound on the number of moves required.

5. **Single Cycle Case:**
   - If the graph is one big cycle, consider the \( 2n \) points with coordinates \((k,0)\) and \((k,1)\) for \( k = 1, 2, \ldots, n \). Adjoin the edge \((n,0)(n,1)\) to \((0,0)(0,1)\) to form a cylinder of height 1.
   - Color these points with the balls accordingly, such that two boxes are adjacent if they share a color. Draw a line segment between two balls of the same color.

6. **Line Segment Types:**
   - There are four types of line segments:
     - (a) Gradient 1
     - (b) Gradient -1
     - (c) Gradient 0 at \( y = 1 \)
     - (d) Gradient 0 at \( y = 0 \)

7. **Swapping Strategy:**
   - Perform a series of swaps to make all line segments either type (a) or (b). Mark the midpoint of each segment. If it is on the line \( y = 0 \), color it red; if it is on the line \( y = 1 \), color it blue.
   - Pair adjacent red and blue points and color the arc linking this pair purple. By swapping all the boxes along this arc, the red and blue points annihilate each other.

8. **Move Calculation:**
   - The number of moves required to orient all line segments similarly is at most \( \left\lfloor \frac{n}{2} \right\rfloor \).
   - Undo the last move, leaving two consecutive horizontal line segments, one above and one below, while the other line segments are oriented the same way.
   - Remove the two balls of the same color on top and put them in the empty box. Repeat this process \( n-2 \) times until only two balls of the same color remain at the bottom.

9. **Total Moves:**
   - The total number of moves is at most \( \left\lfloor \frac{n}{2} \right\rfloor - 1 + n + 1 = \left\lfloor \frac{3n}{2} \right\rfloor \).

The final answer is \( \boxed{\left\lfloor \frac{3n}{2} \right\rfloor} \).