We write on the board the numbers $1, \frac{1}{2}, \ldots, \frac{1}{n}$. At each step, we choose two numbers $a$ and $b$ written on the board, erase them, and write in their place $a+b+a b$. What can be the last number that remains on the board?
We observe that $1+a+b+a b=(1+a)(1+b)$. Therefore, the product of the $1+a$ where $a$ runs through all the numbers written on the board is invariant. Initially, it is $\prod_{k=1}^{n}\left(1+\frac{1}{k}\right)=\prod_{k=1}^{n} \frac{k+1}{k}=n+1$ by telescoping. At the end, if $C$ is the remaining number, it is $1+C$. Therefore, $C=n$.