Jelly, 5 bytes
ÆfI¬S
Port of Luis Mendo's answer in MATL.
ÆfI¬S
Æf Implicit input. Obtain prime factors, sorted and with repetitions
I Consecutive differences
¬ Logical negate: zeros become 1, nonzeros become 0
S Sum. Implicit display