Problem:
 Score : 400 points    Problem Statement  Given is a positive integer N . Consider repeatedly applying the operation below on N :   First, choose a positive integer z satisfying all of the conditions below:  z can be represented as z=p^e , where p is a prime number and e is a positive integer;  z divides N ;  z is different from all integers chosen in previous operations.    Then, replace N with N/z .   Find the maximum number of times the operation can be applied.      Constraints   All values in input are integers.  1 \leq N \leq 10^{12}         Input  Input is given from Standard Input in the following format:  N       Output  Print the maximum number of times the operation can be applied.        Sample Input 1 24      Sample Output 1 3  We can apply the operation three times by, for example, making the following choices:   Choose z=2 (=2^1) . (Now we have N=12 .)  Choose z=3 (=3^1) . (Now we have N=4 .)  Choose z=4 (=2^2) . (Now we have N=1 .)        Sample Input 2 1      Sample Output 2 0  We cannot apply the operation at all.       Sample Input 3 64      Sample Output 3 3  We can apply the operation three times by, for example, making the following choices:   Choose z=2 (=2^1) . (Now we have N=32 .)  Choose z=4 (=2^2) . (Now we have N=8 .)  Choose z=8 (=2^3) . (Now we have N=1 .)        Sample Input 4 1000000007      Sample Output 4 1  We can apply the operation once by, for example, making the following choice:   z=1000000007 (=1000000007^1) . (Now we have N=1 .)        Sample Input 5 997764507000      Sample Output 5 7

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def integer_factorization(n):
    prime_count = collections.Counter()
    for i in range(2, int(math.sqrt(n)) + 2):
        while n % i == 0:
            n //= i
            prime_count[i] += 1
    if n > 1:
        prime_count[n] += 1
    return prime_count

def main():
    n = I()
    d = integer_factorization(n)
    cnt = 0
    for key, val in d.items():
        cur = 1
        used = set()
        while val > 0:
            if cur > val:
                break
            val -= cur
            cnt += 1
            used.add(cur)
            cur += 1
    print(cnt)
main()

Solution (Python):
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr
N=int(input())
A=factorization(N)
ans=0
if N==1:
 print(0)
else:
 for i in range(len(A)):
  ans+=int((2*A[i][1]+0.25)**(0.5)-0.5)
 print(ans)

Solution (Python):
def primes(n):
    n, correction = n-n%6+6, 2-(n%6>1)
    sieve = [True] * (n//3)
    for i in range(1, int(n**0.5)//3+1):
        if sieve[i]:
            k = 3*i+1|1
            sieve[k*k//3::2*k] = [False] * ((n//6-k*k//6-1)//k+1)
            sieve[k*(k-2*(i&1)+4)//3::2*k] = [False] * ((n//6-k*(k-2*(i&1)+4)//6-1)//k+1)
    return [2, 3] + [3*i+1|1 for i in range(1, n//3-correction) if sieve[i]]
from collections import defaultdict

n=int(input())
primelist=primes(int(n**0.5+1))+[n+1]
factors=defaultdict(lambda :0)
for prime in primelist:
    if prime>n:
        factors[n]+=1
        break
    while n%prime==0:
        n=n//prime
        factors[prime]+=1
factors[n]=1

ans=0
for i in factors:
    if i!=1:
        f=factors[i]
        for j in range(1,50):
            f-=j
            if f<0:
                break
            ans+=1
print(ans)

Solution (Python):
import math
def Sieve_of_Eratosthenes(N):
    if N<2:
        prime = [False for i in range(N+1)]
        return prime
 
    prime = [True for i in range(N+1)]
    prime[0] = False
    prime[1] = False
 
    for i in range(2, int(N**0.5)+1):
        if prime[i]:
            for j in range(i*2, N+1, i):
                prime[j] = False
 
    return prime

n=int(input())
prime=Sieve_of_Eratosthenes(int(n**0.5)+100)
ans=0
for p in range(len(prime)):
    if prime[p]==True:
        tp=p
        while n%tp==0:
            ans+=1
            n//=tp
            tp*=p
        
        while n%p==0:
            n//=p
if n!=1: ans+=1
print(ans)

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,copy
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))


def prime_factorize(n):
    if n == 1:
        return [1]
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
n = inp()
if n == 1:
    print(0)
    quit()
c = Counter(prime_factorize(n))
res = 0
for key in list(c):
    va = c[key]
    cnt = 0
    for i in range(1,100000):
        cnt += i
        if va < cnt:
            res += i-1
            break
print(res)

Solution (Python):
import sys
import math

sys.setrecursionlimit(10**7)

n = int(input())
l = []
if n%2 == 0:
    l.append(0)
    while n%2 == 0:
        l[0] += 1
        n /= 2

i = 3
while i*i <= n:
    if n%i == 0:
        l.append(0)
        while n%i == 0:
            l[-1] += 1
            n /= i
    i += 2
if n != 1:
    l.append(1)

ans = 0
for i in range(len(l)):
    j = 1
    while True:
        l[i] -= j
        j += 1
        if l[i] < 0:
            break
        ans += 1
print(ans)

Solution (Python):

from collections import Counter, defaultdict, deque
import math
import sys


buff_readline = sys.stdin.readline
readline = sys.stdin.readline

INF = 2**62-1


def read_int():
    return int(buff_readline())


def read_int_n():
    return list(map(int, buff_readline().split()))


def read_float():
    return float(buff_readline())


def read_float_n():
    return list(map(float, buff_readline().split()))


def read_str():
    return readline().strip()


def read_str_n():
    return readline().strip().split()

def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


def eratosthenes(n):
    p = []
    t = [True] * n

    for i in range(2, int(math.ceil(math.sqrt(n)))):
        if t[i]:
            p.append(i)
            for j in range(2*i, n, i):
                t[j] = False

    for j in range(i+1, n):
        if t[j]:
            p.append(j)

    return p

P = eratosthenes(10**6+1)


class Bisect:
    def __init__(self, func):
        self.__func = func

    def bisect_left(self, x, lo, hi):
        while lo < hi:
            mid = (lo+hi)//2
            if self.__func(mid) < x:
                lo = mid+1
            else:
                hi = mid
        return lo

    def bisect_right(self, x, lo, hi):
        while lo < hi:
            mid = (lo+hi)//2
            if x < self.__func(mid):
                hi = mid
            else:
                lo = mid+1
        return lo

def f(n):
    return (n**2 + n) // 2

@mt
def slv(N):
    if N == 1:
        return 0

    d = Counter()
    for p in P:
        n = 0
        while N % p == 0:
            n += 1
            N //= p
        if n != 0:
            d[p] = n
        if N == 1:
            break
    if N != 1:
        d[N] = 1
    ans = 0
    for p, n in d.items():
        i = Bisect(f).bisect_left(n+1, 0, 10**18)-1
        ans += i

    return ans


def main():
    N = read_int()
    print(slv(N))


if __name__ == '__main__':
    main()

Solution (Python):
def factorize(n):
    fct = []  
    b, e = 2, 0  
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct

tri = [1]
for i in range(2,30):
    tri.append(tri[-1]+i)
n = int(input())
a = factorize(n)
ans = 0
for num,v in a:
    for k,i in enumerate(tri):
        if i > v:
            ans += k
            break
print(ans)

Solution (Python):
def factorization(n):
    arr=[]
    tmp=n
    for i in range(2,int(n**0.5)+1):
        if(tmp%i==0):
            cnt=0
            while tmp%i==0:
                cnt+=1
                tmp//=i
            arr.append([i,cnt])
    if(not arr):
        arr.append([1,1])
    if(tmp!=1):
        arr.append([tmp,1])
    return arr

N=int(input())
if N==1:
    print(0)
    exit()
arr=factorization(N)
ans=0
for i in range(len(arr)):
    if arr[i][0]==1:
        continue
    cnt=1
    while arr[i][1]>0:
        if arr[i][1]>=cnt:
            arr[i][1]-=cnt
            ans+=1
            cnt+=1
        else:
            break
print(ans)

Solution (Python):
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

n=int(input())
a=factorization(n)
b=[ele[1] for ele in a]

ans=0

for num in b:
    now=num
    for cnt in range(1,101):
        if cnt<=now:
            now-=cnt
            ans+=1
        else:
            break

if n==1:
    print(0)
else:
    print(ans)

Solution (Python):

import sys
sys.setrecursionlimit(10**8)
INF = float("inf")

from collections import Counter


def factorial(n):
    prime_count = Counter()

    for i in range(2, int(n**0.5) + 2):
        while n % i == 0:
            n /= i
            prime_count[i] += 1
    if n > 1:
        prime_count[int(n)] += 1

    return prime_count


def main():
    N = int(input())
    pc = factorial(N)                

    ans = 0
    for k, v in pc.items():
        count = 0
        for i in range(1, v+5):
            v -= i
            if v < 0:
                break
            count += 1
        
        ans += count
    print(ans)

    return


if __name__ == '__main__':
    main()

Solution (Python):
import math
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

n=int(input())
ans=0
if n>1:
    array=factorization(n)
    
    ans=0
    for a in array:
        ans+=(-1+math.sqrt(1+8*a[1]))//2
        

print(int(ans))

Solution (Python):
def factorization(n):
    d = {}
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            d[i] = cnt
    
    if temp!=1:
        d[temp] = 1
    
    if len(d) == 0:
        d[n] = 1
    
    return list(d.values())


def calc(n):
    res = 1
    n -= 1
    while n >= res+1:
        res += 1
        n -= res
    return res

N = int(input())
if N == 1:
    print(0)
    quit()

e = factorization(N)
ans = 0
for ei in e:
    ans += calc(ei)

print(ans)

Solution (Python):
n = int(input())

a = []
ans = 0
for i in range(2,int(n**0.5)+1):
    count = 0
    while n%i==0:
        n/=i
        count+=1
    if count!=0:
        for j in range(1,count+10):
            if j*(j+1)/2>count:
                ans+=j-1
                break
if n!=1:
    ans+=1
print(ans)

Solution (Python):
import sys
from bisect import bisect

def solve():
    input = sys.stdin.readline
    N = int(input())
    A = [int(i) + 1 for i in range(40)]
    B = [0] * 41
    for i, a in enumerate(A):
        B[i+1] = B[i] + a
    count = 0
    k = N
    for i in range(2, N+1):
        if i ** 2 > N: break
        if N % i == 0:
            d = 0
            while k % i == 0:
                d += 1
                k //= i
            count += bisect(B, d) - 1
    if k > 1: count += 1
    print(count)

    return 0

if __name__ == "__main__":
    solve()

Solution (Python):
N = int(input())


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == [] and n != 1:
        arr.append([n, 1])

    return arr


factors = factorization(N)

ans = 0
for p, e in factors:
    ans += int((-1 + (8 * e + 1) ** 0.5) / 2)

print(ans)

Solution (Python):
import sys
from math import floor
def input(): return sys.stdin.readline().strip()
mod = 10**9+7

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

def main():
    N = int(input())
    if N== 1:
        print(0)
        return
    
    arr = factorization(N)
    ans = 0
    for p, i in arr:
        num = 0
        while num * (num + 1) // 2 <= i: num += 1
        ans += num - 1
    print(ans)

    

if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())

def factorize(n):
    if n == 1: return []
    res = []
    x, y = n, 2
    while y * y <= x:
        while x % y == 0:
            res.append(y)
            x //= y
        y += 1
    if x > 1:
        res.append(x)
    return res

from collections import Counter

F = factorize(N)
C = Counter(F)


res = 0

if N == 1:
    print(0)
else:
    for k, v in C.items():
        tmp = 0
        while True:
            if (tmp + 1) * (tmp + 2) // 2 > v:
                res += tmp
                break
            tmp += 1

    print(res)

Solution (Python):




import math
import sys
import bisect
import heapq  
from collections import deque
inf = 10 ** 18
mod = 10 ** 9 + 7

def factorization(n):
    arr = []
    temp = n
    if n == 1:
        return arr

    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

n = int(input())
tmp = factorization(n)
ans=0
judge = [(i*(i+1))//2 for i in range(1,10)]
def getC(x):
    ind = bisect.bisect_left(judge, x)
    if judge[ind] == x:
        return ind+1
    else:
        return ind
for a,b in tmp:
    ans+=getC(b)
print(ans)

Solution (Python):
from math import gcd, sqrt, cos, radians, pi
from collections import defaultdict as d
from itertools import combinations as c

n = int(input())





div = []
tmp = n
if n % 2 == 0:
	div.append(2)
	while n % 2 == 0:
		n //= 2
for i in range(3, int(n**.5)+2, 2):
	if n % i == 0:
		div.append(i)
		while n % i == 0:
			n //= i

if n > 1:
	div.append(n)

s = 0
exp = 1
n = tmp
while n > 1:
	f = 0
	for v in div:
		if n > 1:
			if n % (v**exp) == 0:
				s += 1
				f = 1
				n //= (v**exp)
	exp += 1
	if not f:
		break
	
print(s)

Solution (Python):
import sys
input = sys.stdin.readline
from collections import *

def factorize(n):
    fct = []
    
    for i in range(2, int(n**0.5)+1):
        c = 0
        
        while n%i==0:
            n //= i
            c += 1
            
        if c>0:
            fct.append((i, c))
    
    if n>1:
        fct.append((n, 1))
    
    return fct

N = int(input())
fs = factorize(N)
ans = 0

for _, C in fs:
    c = 1
    
    while C-c>=0:
        ans += 1
        C -= c
        c += 1

print(ans)

Solution (Python):
n=int(input())
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(n**0.5)+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr
if n==1:
    print(0)
    exit()
a=factorization(n)
ans=0
for i in a:
    k=i[1]
    ans+=int((-1+(1+8*k)**(0.5))/2)
print(ans)

Solution (Python):
"""素因数分解
Returns:
    list -- [[prime, index], ...]
"""

def factorization(n):
    res = []
    tmp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if tmp % i == 0:
            cnt = 0
            while tmp % i == 0:
                cnt += 1
                tmp //= i
            res.append([i, cnt])
    if tmp != 1:
        res.append([tmp, 1])
    if res == []:
        res.append([n, 1])
    return res

N = int(input())

if N == 1:
    print(0)
    exit()

res = factorization(N)

ans = 0

for r in res:
    m = 1
    while (m*(m+1)//2 <= r[1]):
        m += 1
    ans += m-1

print(ans)

Solution (Python):
import math
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0:
        cnt+=1
        temp //= i
      arr.append(cnt)
  if temp!=1:
    arr.append(1)
  if arr==[]:
    arr.append(1)
  return arr
n = int(input())
if n== 1:
  print(0)
  exit()
x = factorization(n)
c = 0
for xi in x:
  s = 0
  i = 1
  while True:
    if s+i <=xi:
      s += i
      c += 1
    else:
      break
    i += 1    
print(c)

Solution (Python):

import bisect
import collections
import sys

sys.setrecursionlimit(1000000)
ACMOD = 1000000007
INF = 1 << 62


def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


def solve(N: int):
    ans = 0
    d = collections.Counter(prime_factorize(N))
    for p, count in d.items():
        tmp = 1
        while count > 0:
            count -= tmp
            if count >= 0:
                ans += 1
            tmp += 1

    print(ans)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())

p = []
cnt = 0
while N % 2 == 0:
	cnt += 1
	N = N // 2
if cnt > 0:
	p.append(cnt)

t = 3
while N >= t and t <= 10**6:
	cnt = 0
	while N % t == 0:
		cnt += 1
		N = N // t
	if cnt > 0:
		p.append(cnt)
	t += 2

if N > 10**6:
	p.append(1)

ans = 0
for c in p:
	a = int((-1 + pow(1+8*c, 0.5))/2)
	ans += a
print(ans)

Solution (Python):
N = int(input())

f = {}
p = 2
while p*p<=N:
    if N%p==0: f[p]=0
    while N%p==0:
        N//=p
        f[p]+=1
    p+=1

if N>1: f[N]=1

ans = 0
for v in f.values():
    n = s = 0
    while s<=v:
        n+=1
        s+=n
    ans += n-1

print(ans)

Solution (Python):

n = int (input())
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr
ans = 0
if n == 1:
    print(0)
else:
    for i in range(len(factorization(n))):
        s = factorization(n)[i][1]
        ans +=  int((-1+(1+8*s)**(1/2))/2)




    print(ans)

Solution (Python):

import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [Scanner.string() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [Scanner.int() for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def divisor(n):
        res = []
        i = 1
        for i in range(1, int(n ** 0.5) + 1):
            if n % i == 0:
                res.append(i)
                if i != n // i:
                    res.append(n // i)
        return res

    @staticmethod
    def round_up(a, b):
        return -(-a // b)

    @staticmethod
    def is_prime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True


def pop_count(x):
    x = x - ((x >> 1) & 0x5555555555555555)
    x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f
    x = x + (x >> 8)
    x = x + (x >> 16)
    x = x + (x >> 32)
    return x & 0x0000007f


MOD = int(1e09) + 7
INF = int(1e15)


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


def solve():
    N = Scanner.int()
    if N == 1:
        print(0)
        return
    fact = factorization(N)
    ans = 0
    for f in fact:
        t = f[1]
        i = 1
        while t - i >= 0:
            ans += 1
            t -= i
            i += 1
    print(ans)


def main():
    
    
    solve()


if __name__ == "__main__":
    main()

Solution (Python):
from bisect import bisect as bisect
l = [0]*100000
for i in range(len(l)):
    l[i] = (i*(i+1))//2

N = int(input())
def prime_decomposition(n):
  i = 2
  d = {}
  while i * i <= n:
    while n % i == 0:
      n //= i
      if i not in d:
          d[i] = 0
      d[i] += 1
    i += 1
  if n > 1:
    if n not in d:
        d[n] = 1
  return d

d = prime_decomposition(N)
ans = 0
for i in d:
    ans += bisect(l,d[i])-1
print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(300000)

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')

def factorize(n):
    """
    nの値を素因数分解し、素因数とその指数をtupleにまとめたリストを返す
    e.g.
    factorize(20)
    [(2, 2), (5, 1)]
    """
    b = 2
    fct = []
    while b * b <= n:
        cnt = 0
        while n % b == 0:
            cnt += 1
            n //= b
        if cnt > 0:
            fct.append((b, cnt))
        b += 1
    if n > 1:
        fct.append((n, 1))
    return fct


N = I()
ans = 0
for p, e in factorize(N):
    if p == 1:
        continue
    i = 1
    cnt = 0
    while e - i >= 0:
        e = e - i
        i = i + 1
        cnt += 1
    ans += cnt
print(ans)

Solution (Python):
N = int(input())

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

ansNums = factorization(N)
ans = 0

for a in ansNums:
    if a[0] == 1:
        break
    cnt = 1
    while a[1] >= cnt:
        a[1] -= cnt
        ans += 1
        cnt += 1

print(ans)

Solution (Python):
def factoring(k): 
    import math
    dic = dict()
    n = int(math.sqrt(k))+2
    for i in range(2, n):
        count = 0
        while k%i == 0:
            count += 1
            k = k//i
        if count != 0:
            dic[i] = count
    if k != 1: 
        dic[k] = 1
    return dic

N = int(input())

dic = factoring(N)

def calc(x):
    k = 0
    while True:
        if k * (k + 1) // 2 > x:
            return k - 1
        k += 1


ans = 0
for i in dic:
    tmp = dic[i]
    ans += calc(tmp)

print (ans)

Solution (Python):
N = int(input())

if N == 1:
    print(0)
    exit()

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

import collections
c = collections.Counter(prime_factorize(N))


ans = 0
for key in c.keys():
    i = 1
    while True:
        c[key] -= i
        ans += 1
        i += 1
        if c[key] < i:
            break

print(ans)

Solution (Python):
import sys
input = sys.stdin.readline

n = int(input())

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

a = prime_factorize(n)
from collections import Counter
c = Counter(a)
ans = 0
for i in c.keys():
    cnt = 1
    while c[i] >= cnt:
        ans += 1
        c[i] -= cnt
        cnt += 1
print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def mina(*argv, sub=1): return list(map(lambda x: x - sub, argv))



def read_a_int(): return int(read())


def read_ints(): return list(map(int, read().split()))


def read_col(H):
    '''H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) 
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_tuple(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_matrix(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    


def factorization(n: int):
    if n == 1:
        return []  
    
    arr = []
    temp = n
    for i in range(2, int(n**0.5) + 1):  
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append((i, cnt))

    if temp != 1:
        arr.append((temp, 1))

    if arr == []:
        arr.append((n, 1))

    return arr


MOD = 10**9 + 7
INF = 2**31  

from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  

N = read_a_int()






fact = factorization(N)

ans = 0
for p, e in fact:
    sub = 1  
    while sub <= e:
        ans += 1
        e -= sub
        sub += 1
print(ans)

Solution (Python):


import sys
readline = sys.stdin.readline
read = sys.stdin.read

n, = map(int,input().split())

x = [0,1,3,6,10,15,21,28,36,45,55,66]

from bisect import bisect_right
ans = 0
N = 10**6
for i in range(2,N):
    r = 0
    while n%i==0:
        n//=i
        r += 1
        
    if r>0:
        ans += bisect_right(x,r)-1        
        

if n!=1:
    
    ans += 1    
    
print(ans)

Solution (Python):
from collections import Counter
num = int(input())
def pr(n):
   a = []
   while n % 2 == 0:
        a.append(2)
        n //= 2
   f = 3
   while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
   if n != 1:
      a.append(n)
   return a
if num == 1:
   print(0)
   quit()
prm = Counter(pr(num)).items()
ans = 0
for el,nm in prm:
   x = 1
   while True:
      if nm >= x:
         nm -= x
         ans += 1
         x += 1
      else:
         break
print(ans)

Solution (Python):
N = int(input())

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

li = factorization(N) 
ans = 0
for l in li:
    n = l[0]
    if n == 1:
        continue
    count = l[1]
    ans += 1
    now = 1
    count -= 1
    while count > 0:
        now += 1
        count -= now
        if count >= 0:
            ans += 1

print(ans)

Solution (Python):
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


def calc(num):
    ret = 0
    left = num
    count = 1
    while True:
        if left >= count:
            ret = count
            left -= count
            count += 1
        else:
            break
    return ret


n = int(input())

ret = factorization(n)

val = 0

for tmp, num in ret:
    if tmp == 1:
        continue
    val += calc(num)

print(val)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


def input():
    return sys.stdin.readline().strip()


def factorization(n):
    d = {}
    tmp = n
    for i in range(2, int(n ** 0.5) + 1):
        if tmp % i == 0:
            cnt = 0
            while tmp % i == 0:
                cnt += 1
                tmp //= i
            d[i] = cnt

    if tmp != 1:
        d[tmp] = 1

    return d


def main():
    N = int(input())
    d = factorization(N)
    ans = 0
    for k, v in d.items():
        i = 1
        while v - i >= 0 and N % (k ** i) == 0:
            v -= i
            ans += 1
            N //= k ** i
            i += 1
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
import sys
input=lambda: sys.stdin.readline().rstrip()
n=int(input())
pf={}
for i in range(2,int(n**0.5)+1):
  while n%i==0:
    pf[i]=pf.get(i,0)+1
    n//=i
if n>1:
  pf[n]=1
ans=0
for p in pf.keys():
  d=pf[p]
  tot=1
  cur=1
  ct=0
  while tot<=d:
    ct+=1
    if tot+cur+1>d:
      break
    else:
      cur+=1
      tot+=cur
  ans+=ct
print(ans)