Classification of surfaces The Classification Theorem for surfaces says that a compact connected surface $M$ is homeomorphic to $$S^2\# (\#_{g}T^2)\# (\#_{b} D^2)\# (\#_{c} \mathbb{R}P^2),$$ so $g$ is the genus of the surface, $b$ the number of boundary components and $c$ the number of projective planes.
From there, it is easy to compute $\chi(M)=2-2g-b-c$.
Nevertheless, I have read another statement of The Classification Theorem that states that a compact connected surface is determined by its orientability (yes/no), the number of boundary components and its Euler characteristic.
I do not understand how is it possible to know the decomposition of $M$ as a connected sum by knowing that. By knowing $b$, there are still two variables, $c$ and $g$ which have to be known from $\chi(M)$, and orientability only tells us if $c=0$ or $c\geq 1$. Can someone help me, please?

Since $\mathbb{R}P^2\# \mathbb{R}P^2\#\mathbb{R}P^2\cong \mathbb{R}P^2 \# T^2$, $c$ and $g$ are not uniquely determined: if $c\geq 3$, you can subtract $2$ from $c$ and add $1$ to $g$ and get the same surface, or if $c,g\geq 1$, you can subtract $1$ from $g$ and add $2$ to $c$.
Note, though, that the first operation can always be used to get a connected sum presentation where $c\leq 2$. If you impose the additional restriction that $c\leq 2$, then $c$ and $g$ can be uniquely determined and can be calculated from the data you mention.  If the surface is orientable, then $c=0$ and then you can just solve for $g$.  If the surface is not orientable, then you can determine whether $c=1$ or $c=2$ since $c$ must have the same parity as $\chi(M)+b$.  Once $c$ is determined, you can solve for $g$.
