input: Write a python function to count the number of unique prime factors of a given number.
  assert count_unique_prime_factors(24) == 2
  assert count_unique_prime_factors(30) == 3
  assert count_unique_prime_factors(17) == 1
output: def count_unique_prime_factors(n):
      def is_prime(num):
          if num <= 1:
              return False
          if num <= 3:
              return True
          if num % 2 == 0 or num % 3 == 0:
              return False
          i = 5
          while i * i <= num:
              if num % i == 0 or num % (i + 2) == 0:
                  return False
              i += 6
          return True
      
      unique_primes = set()
      for i in range(2, n + 1):
          if n % i == 0 and is_prime(i):
              unique_primes.add(i)
      
      return len(unique_primes)