#!/usr/local/gnu/bin/bash
read n
if((n==1))
then
    echo 0
    exit
fi
a=(`echo $n | factor | sed -r "s/^.*://"`)
l=(`echo ${a[@]} | tr ' ' '\n' | uniq -c | sed -r "s/([0-9]+) ([0-9]+)/\1/g"`)
s=0
for i in ${l[@]}
do
    q=1
    while((i>=q*(q+1)/2))
    do
        s=$((s+1))
        q=$((q+1))
    done
done
echo $s
