from itertools import accumulate

from collections import defaultdict





def main():

    n = int(eval(input()))

    prime_counter = defaultdict(int)  # key ^ value

    acc = tuple(accumulate(list(range(1, 42))))  # because 10^12 < 2^39



    def facs():

        yield 2

        for x in range(10 ** 5 * 5):

            yield x * 2 + 3



    for fac in facs():

        count = 0

        while n % fac == 0:

            n //= fac

            count += 1

            # ここで if braek を入れると遅い？

        prime_counter[count] += 1

    if n != 1:

        prime_counter[1] += 1



    ans = 0

    for prime_count, count_count in list(prime_counter.items()):

        for i, x in enumerate(acc):

            if prime_count < x:

                tmp = i

                break

        ans += tmp * count_count

    print(ans)





if __name__ == '__main__':

    main()

from itertools import accumulate

from collections import defaultdict





def main():

    n = int(eval(input()))

    prime_counter = defaultdict(int)  # key ^ value

    acc = tuple(accumulate(list(range(1, 42))))  # because 10^12 < 2^39



    def facs(n):

        yield 2

        max_x = int((n ** 0.5 - 3) / 2 + 1)

        for x in range(max_x):

            yield x * 2 + 3



    for fac in facs(n):

        while n % fac == 0:

            n //= fac

            prime_counter[fac] += 1

            # ここで if fac * fac > n: braek を入れると，

            # 計算量の少ないケースでは早く，多いケースでは遅くなる。

    if n != 1:

        prime_counter[n] += 1



    ans = 0

    for c in list(prime_counter.values()):

        for i, x in enumerate(acc):

            if c < x:

                tmp = i

                break

        ans += tmp

    print(ans)





if __name__ == '__main__':

    main()

from itertools import accumulate
from collections import defaultdict


def main():
    n = int(eval(input()))
    prime_counter = defaultdict(int)  # key ^ value
    acc = tuple(accumulate(list(range(1, 42))))  # because 10^12 < 2^39

    def facs():
        yield 2
        for x in range(10**5 * 5):
            yield x * 2 + 3

    for fac in facs():
        count = 0
        while n % fac == 0:
            n //= fac
            count += 1
            # ここで if braek を入れると遅い？
        prime_counter[count] += 1
    if n != 1:
        prime_counter[1] += 1
    ans = 0
    for prime_count, count_count in list(prime_counter.items()):
        for i, x in enumerate(acc):
            if prime_count < x:
                tmp = i
                break
        ans += tmp * count_count
    print(ans)


if __name__ == "__main__":
    main()

from itertools import accumulate
from collections import defaultdict


def main():
    n = int(eval(input()))
    prime_counter = defaultdict(int)  # key ^ value
    acc = tuple(accumulate(list(range(1, 42))))  # because 10^12 < 2^39

    def facs(n):
        yield 2
        max_x = int((n**0.5 - 3) / 2 + 1)
        for x in range(max_x):
            yield x * 2 + 3

    for fac in facs(n):
        while n % fac == 0:
            n //= fac
            prime_counter[fac] += 1
            # ここで if fac * fac > n: braek を入れると，
            # 計算量の少ないケースでは早く，多いケースでは遅くなる。
    if n != 1:
        prime_counter[n] += 1
    ans = 0
    for c in list(prime_counter.values()):
        for i, x in enumerate(acc):
            if c < x:
                tmp = i
                break
        ans += tmp
    print(ans)


if __name__ == "__main__":
    main()

-    def facs(): +    def facs(n): -        for x in range(10**5 * 5): +        max_x = int((n**0.5 - 3) / 2 + 1) +        for x in range(max_x): -    for fac in facs(): -        count = 0 +    for fac in facs(n): -            count += 1 -            # ここで if braek を入れると遅い？ -        prime_counter[count] += 1 +            prime_counter[fac] += 1 +            # ここで if fac * fac > n: braek を入れると， +            # 計算量の少ないケースでは早く，多いケースでは遅くなる。 -        prime_counter[1] += 1 +        prime_counter[n] += 1 -    for prime_count, count_count in list(prime_counter.items()): +    for c in list(prime_counter.values()): -            if prime_count < x: +            if c < x: -        ans += tmp * count_count +        ans += tmp