Let $m$ be a positive integer such that $m$ has exactly $8$ positive divisors. How many distinct prime factors does $m$ have?