How many unique primes? One way to represent a natural number is by multiplying exponents of prime numbers.  For example, 6 can be represented by 2^1*3^1, and 50 can be represented by 2^1*5^2 (where ^ indicates exponention).  The number of primes in this representation can help determine whether it is shorter to use this method of representation, compared to other methods.  But because I don't want to calculate these by hand, I need a program to do it for me.  However, because I'll have to remember the program until I get home, it needs to be as short as possible.  

Your Task:

Write a program or function to determine how many distinct primes there are in this representation of a number.  

Input:

An integer n such that 1 &lt; n &lt; 10^12, taken by any normal method.  

Output:

The number of distinct primes that are required to represent the input, as outlined in the introduction.  

Test Cases:

24      -&gt; 2 (2^3*3^1)
126     -&gt; 3 (2^1*3^2*7^1)
1538493 -&gt; 4 (3^1*11^1*23^1*2027^1)
123456  -&gt; 3 (2^6*3^1*643^1)


This is OEIS A001221.

Scoring:

This is code-golf, lowest score in bytes wins!
MATL, 4 3 bytes

-1 byte thanks to Luis Mendo

YFz


Try it online!

YF         Exponents of prime factors
  z        Number of nonzeros


Original answer:

Yfun


Try it online!

A verYfun answer.

          (Implicit input)
Yf         Prime factorization
  u        Unique
   n       Numel
           (Implicit output)