n = p2q, where p and q are prime.
So, number of multiple of p in n = pq
Number of multiples of q in n = p2
Number of multiples of pq in n = p
Since prime factorisation of n consists of only p and q, gcd(m, n) will be a multiple of these or 1. So, number of possible m such that gcd(m, n) is 1 will be n - number of multiples of either p or q.
= n - p2-pq+p