This is how I'm visualizing it.
$\hskip{.75in}$![enter image description here](
Men are represented by the blue circle, women by the red, and married individuals by the green. From here, we can make a system of equations.
There are 15 men $\Rightarrow$ $A + B = 15$.
There are 20 women $\Rightarrow$ $C + D = 20$.
18 are not married $\Rightarrow$ $A + D = 18$.
17 people are married $\Rightarrow$ $B + C = 17$.
27 people are married or women $\Rightarrow$ $B + C + D = 27$.
Solving this sytem of equations will give you all the variables. You are looking for $A$.