You can
put this solution on YOUR website!
n(AnB) is 3, which is already given.
You probably meant to ask 'find n(AuB)' (?), in which case n(AuB) = 8+12-3 = 17.
The number of elements in the intersection is subtracted once because it is counted twice (once in A and once in B). See inclusion-exclusion principle.