You have three unknowns ($x, y, z$) and knowing the total number of people gives you the third equation that you need to solve the system. In other words, you have:
$$ \begin{align} y+x=50\\\ y+z=25\\\ y+x+z=65 \end{align} $$
which hopefully should not be a problem to solve.