Pair terms:
$\tan1^\circ \cdot \tan44^\circ$, $\tan2^\circ \cdot \tan43^\circ$, ..., and note:
\[
(1 + \tan1^\circ)(1 + \tan44^\circ),\quad
(1 + \tan2^\circ)(1 + \tan43^\circ), \dots
\]
Each pair gives some product; total pairs = 22, plus 1 for $\tan45^\circ = 1$
So the total product becomes:
\[
(1 + \tan1^\circ)(1 + \tan2^\circ)\dots(1 + \tan45^\circ) = 2^{23}
\Rightarrow n = 23
\]