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):
n = int(input())
import math
from bisect import bisect
ps = {}
for i in range(2,math.ceil(math.sqrt(n))):
  while n % i == 0:
    n //= i
    if i in ps:
      ps[i] += 1
    else:
      ps[i] = 1
  if n == 1:
    break
if n > 1:
  ps[n] = 1

ss = [i*(i+1)//2 for i in range(1,42)]

ans = 0
for p in ps:
  ans += bisect(ss, ps[p])
print(ans)

Solution (Python):
n = int(input())
p = 2
ans = 0
while n > 1:
    if p > 10 ** 6:
        ans += 1
        break
    e = 1
    while n % (p ** e) == 0:
        n = n // (p ** e)
        e += 1
        ans += 1
    while n % p == 0:
        n = n // p
    p += 1
    
print(ans)

Solution (Python):
from collections import Counter
from bisect import bisect_right

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 main():
    N = int(input())

    nums = [0] * 42
    nums[1] = 1
    for i in range(1, 41):
        nums[i+1] = nums[i] + (i+1)
    
    factor = prime_factorize(N)
    c = Counter(factor)
    ans = 0

    for val in c.values():
        idx = bisect_right(nums, val)
        ans += idx - 1
    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce, lru_cache  
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return (int(x) for x in input().split())
def LI(): return list(Is())
def TI(): return tuple(Is())
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(S())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = 10**18


n = I()

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

def prime_factorize_tuple(n):
    ret = []
    tmp = n
    for i in range(2, ceil(sqrt(n))):
        if tmp % i == 0:
            count = 0
            while tmp % i == 0:
                count += 1
                tmp //= i
            ret.append((i, count))

    if tmp != 1:
        ret.append((tmp, 1))

    if not ret:
        ret.append([n, 1])  

    return ret

def check(n, x):
    return n*(n+1)//2 <= x

def meguru_bisect(ng, ok, x):
    """
    初期値のng,okを受け取り, check=>Trueを満たす最大値(最小値)を返す
    条件を満たす最大値を求める場合、初期値は(ng:上限の外, ok:下限の外)   例) 10**9+1, -1
    条件を満たす最小値を求める場合、初期値は(ng:下限の外, ok:上限の外)   例) -1, 10**9+1
    上限の外や下限の外が返ってくる場合は条件を満たす値が範囲内になかったことを示すので、例外処理が必要
    """
    while abs(ok - ng) > 1:
        mid = (ok + ng) // 2
        if check(mid, x):
            ok = mid
        else:
            ng = mid
    return ok

ans = 0
for p, x in prime_factorize_tuple(n):
    ans += meguru_bisect(10**13, 0, x)

print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(2 * 10**6)


def inpl():
    return list(map(int, input().split()))


def divide(N):
    ret = {}
    p = 2
    tn = int(N**0.5)
    while N != 1:
        if N % p == 0:
            if p not in ret:
                ret[p] = 1
            else:
                ret[p] += 1
            N //= p
        elif p > tn:
            p = N
        else:
            p += 1

    return ret


def solve(N):
    p_dict = divide(N)
    ans = 0
    for v in p_dict.values():
        ans += int(((1 + 8 * v)**0.5 - 1) * 0.5)
    return ans


def main():

    N = int(input())
    print(solve(N))

    return


if __name__ == '__main__':
    main()

Solution (Python):
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
  

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


ans = 0
for k,v in c.items():
  cnt = 1
  while(v >= cnt):
    v -= cnt
    ans += 1
    cnt += 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])

    return arr


n = int(input())
factors = factorization(n)

ans = 0
for factor, count in factors:
    use = 1
    possible = count
    while possible >= use:
        possible -= use
        use += 1
        ans += 1

print(ans)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7




def factorization(n):
	arr = []
	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
			arr.append([i, cnt])
	if tmp != 1:
		arr.append([tmp, 1])

	return arr
	
N = INT()

arr = factorization(N)
lis = []
for i, j in arr:
	for k in range(1, j+1):
		lis.append(i**k)

lis.sort()



cnt = 0
for x in lis:
	if N%x == 0:
		cnt += 1
		N //= x

print(cnt)

Solution (Python):
from collections import Counter
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 main():
    N = int(input())
    l = prime_factorize(N)
    c = Counter(l)
    r = 0
    ll = [0]
    for i in range(1, 100):
        ll.append(ll[-1] + i)
    for i in c.values():
        for j in range(100):
            if ll[j] > i:
                r += j - 1
                break
    return r

print(main())

Solution (Python):
import math

def trial_division(n):
    
    factor = []
    
    tmp = int(math.sqrt(n)) + 1
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            factor.append(num)
    
    if not factor:
        return [n]
    else:
        factor.append(n)
        return factor
A = trial_division(int(input()))
from collections import Counter
C = Counter(A)
ans=0
for k,i in C.items():
  if k==1:
    continue
  for j in range(1,40):
    i = i-j
    if i>=0:
      ans +=1
print(ans)

Solution (Python):


n = int(input())

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


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


t = factorization(n)

ans = 0
for (p, i) in t:
    c = 0
    while True:
        c += 1
        if i >= c:
            i -= c
        else:
            break
    ans += (c-1)
print(ans)

Solution (Python):
import math
def primes(N):
    P = []
    for i in range(2,N):
        sieve = 1
        for p in P:
            if p*p > i:
                break
            elif i % p == 0:
                sieve = 0
                break
        if sieve == 0:
            continue
        else:
            P.append(i)
    return P
def factorize(n, P=None):
    if P is None:
        P = primes(int(math.sqrt(n))+1)
    factor = []
    power = []
    for p in P:
        if p * p > n:
            break
        elif n % p == 0:
            k = 0
            while n % p == 0:
                n //= p
                k += 1
            factor.append(p)
            power.append(k)
    if n > 1:
        factor.append(n)
        power.append(1)
    return factor, power

N = int(input())
factor, power = factorize(N)
ans = sum(int((math.sqrt(1+8*x)-1)/2) for x in power)
print(ans)

Solution (Python):
import sys
import math 
from collections import defaultdict
input = lambda : sys.stdin.readline().strip()
n = int(input())
factors = defaultdict(int)
while n%2==0:
    factors[2]+=1
    n = n//2
for i in range(3,int(n**0.5)+1,2):
    while n%i==0:
        factors[i]+=1
        n = n//i 
if n>2:
    factors[n]+=1
ans = 0
for k in factors:
    ans += (-1+int((1+8*(factors[k]))**0.5))//2
print(ans)

Solution (Python):
def primelist(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

def factorization(n):
    plist = primelist(int(n**0.5))
    factor = []
    for p in plist:
        k = 0
        while n%p==0:
            k+=1
            n//=p
        if k>0:
            factor.append((p,k))
        if n==1:
            break
    if n!=1:
        factor.append((n,1))

    return factor

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

    divisors.sort()
    return divisors


def main():
    n = int(input())
    
    factors = factorization(n)

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

    print(ans)


if __name__ == "__main__":
    main()

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

def main():
    N = int(input())
    if N == 1:
        print(0)
        exit()
    
    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
    
    c = factorization(N)
    
    can = []
    for i in range(1,50):
        can.append((i*(i+1))//2)

    ans = 0
    for _,cnt in c:
        ind = bisect.bisect_right(can,cnt)
        ans += ind
    
    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):
n=int(input())
def fact(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

x=fact(n)
ans=0
for i in range(len(x)):
  for j in range(1,1000):
    if x[i][1]>=j:
      ans+=1
      x[i][1]-=j
print(ans)

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

import collections
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

c = collections.Counter(prime_factorize(n))
res = 0
for key,value in c.items():
    i = 1
    while value >= i :
        value -= i
        res+=1
        i+=1
print(res)

Solution (Python):
import sys
from bisect import bisect_right

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


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 not arr:
        arr.append([n, 1])
    
    return arr


def solve():
    N = int(rl())
    
    if N == 1:
        print(0)
        return
    
    acc = [1]
    for i in range(2, 100):
        acc.append(acc[-1] + i)
    
    facts = factorization(N)
    ans = 0
    for fact, exp in facts:
        ans += bisect_right(acc, exp)
    print(ans)


if __name__ == '__main__':
    solve()

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
for a, b in A:
    if a == 1:
        continue
    cnt = b
    for i in range(1, b+1):
        if cnt < i:
            break
        cnt -= i
        ans += 1
print(ans)

Solution (Python):
n=int(input())
def prime_factors(n):
    i = 2
    factors = []
    while i * i <= n:
        if n % i:
            i += 1
        else:
            a=n//i 
            if (a+1)*i<=n:
              a+=1
            n=a
            factors.append(i)
    if n > 1:
        factors.append(n)
    return factors
a=prime_factors(n)
current=0
index=0
anslist=[]
for i in range(len(a)):
  if a[i]!=current:
    current=a[i]
    anslist.append(1)
  else:
    anslist[-1]+=1
ans=0
for i in anslist:
  k=1
  while (k*(k+1))<=2*i:
    k+=1
  k-=1
  ans+=k
print(ans)

Solution (Python):
import sys

sys.setrecursionlimit(1000000)

import bisect
import math
import collections
import heapq

def factrization(N):
    k = 2
    ret = {}
    L = N ** 0.5
    while k < L:
        if N % k == 0:
            ret.setdefault(k, 0)
            ret[k] += 1
            N //= k
        else:
            k += 1
    if N > 1:
        ret.setdefault(N, 0)
        ret[N] += 1
    return ret






def solve(N):
    f = factrization(N)
    ans = 0
    for n in f.values():
        i = 1
        while i <= n:
            n -= i
            i += 1
            ans += 1
    return ans







if __name__ == "__main__":
    N = int(input())
    print(solve(N))

Solution (Python):
N = int(input())
if N==1:
    print(0)
    exit()

from collections import Counter
def factorize(n):
    d = Counter()
    m = 2
    while m*m <= n:
        while n%m == 0:
            n //= m
            d[m] += 1
        m += 1
    if n > 1:
        d[n] += 1
    return d

fac = factorize(N)
if len(fac)==1 and N in fac:
    print(1)
    exit()

ans = 0
for v in fac.values():
    n = 1
    while v >= n:
        v -= n
        ans += 1
        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
fact = factorization( n )

cnt = 0
for f in fact:
  if f[0] == 1:
    continue
  fa = f[ 1 ]
  fa -= 1
  i = 2
  while fa >= 0:
    cnt += 1
    fa -= i
    i += 1
print( cnt )

Solution (Python):
from collections import Counter

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

N=int(input())
c=Counter(p(N))
ans=0
for k,v in c.items():
    i=1
    j=1
    while i<=v:
        ans+=1
        j+=1
        i+=j
print(ans)

Solution (Python):
import math
def f(n):
    if n==1:
        return [[1,0]]
    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=f(int(input()))
s=0
for i in n:
    p=i[1]
    s+=int((-1+math.sqrt(1+8*p))/2)
print(s)

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

def s2n(s):
    m = 0
    for i in range(1, 9):
        if i * (i+1) // 2 <= s:
            m = i
        else:
            break
    return m

if n == 1:
    print(0)
else:
    ans = 0
    for [p, esum] in factorization(n):
        ans += s2n(esum)
    print(ans)

Solution (Python):
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 math
N = int(input())
A = prime_factorize(N)
B = list(set(A))
kosuu = [0]*len(B)
ans = 0
for i in range(len(B)):
    kosuu[i] = A.count(B[i])
for i in range(len(kosuu)):
    for j in range(1, int(math.sqrt(N))):
        kosuu[i] -= j
        if kosuu[i] >= 0:
            ans += 1
        else:
            break
print(ans)

Solution (Python):
import collections
import bisect

n = 10 ** 6 + 10
fl = [1] * n
fl[0] = 0
fl[1] = 0
lprime = []
for i in range(n):
    if fl[i] == 1:
        lprime.append(i)
        ti = i * 2
        while ti < n:
            fl[ti] = 0
            ti += i


def prime_factorize(n):
    global lprime
    a = []
    for p in lprime:
        if p * p > n:
            break
        while n % p == 0:
            a.append(p)
            n //= p
    if n != 1:
        a.append(n)
    return a


N = int(input())
tres = prime_factorize(N)
ctres = collections.Counter(tres)
sl = [1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66]
res = 0
for c in ctres.values():
    res += bisect.bisect_right(sl, c)
print(res)

Solution (Python):
def prime_factor(x):
    
    prime_factor=[]
    
    for i in range(2,int(x**0.5)+1):
        if x==1: break

        count = 0
        while x%i == 0:
            x //= i
            count += 1
        if count>0:
            prime_factor.append((i,count))
    
    if x>1: prime_factor.append((x,1))
    
    return prime_factor

def count(x):
    ret = 1
    for i in range(1,x):
        if i*(i+1)//2 <= x:
            ret = i
        else:
            break
    return ret

n = int(input())
ans = 0
for p,esum in prime_factor(n):
    ans += count(esum)
print(ans)

Solution (Python):
import sys, bisect, math, itertools, string, queue, copy


from collections import Counter,defaultdict,deque
from itertools import permutations, combinations, combinations_with_replacement
from heapq import heappop, heappush
from fractions import gcd

sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

def div3(x): 
    div = defaultdict(int)
    check = 2
    while(x!=1 and check <= int(x**0.5)+2):
        while x%check == 0:
            div[check] += 1
            x /= check
        check += 1
    if x != 1:
      div[x] += 1
    return div

def main():
    n = inp()
    dp = [i for i in range(51)]
    for i in range(50):
        dp[i+1] += dp[i]
    div = div3(n)
    ans = 0
    for e in div:
        ans += bisect.bisect_right(dp,div[e]) - 1
    print(ans)
    
if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
primes = []
t = 2
n_ = n
while t*t <= n_ and t*t < n:
    if n % t == 0:
        cnt = 1
        while n % (t ** (cnt+1)) == 0:
            cnt += 1
        primes.append([t,cnt])
        n //= (t**cnt)
    t += 1
if n != 1:
    primes.append([n,1])

def largest_tri(m):
    cnt = 0
    for i in range(1,m+3):
        cnt += i
        if cnt > m:
            return i - 1

ret = 0
for p in primes:
    ret += largest_tri(p[1])
print(ret)

Solution (Python):
from bisect import bisect_left
from collections import defaultdict

n = int(input())
if n == 1:
    print(0)
    exit()


def prime_factor(n):
    
    d = defaultdict(int)
    for i in range(2, int(n ** 0.5) + 1):
        while n % i == 0:
            d[i] += 1
            n //= i
    if n != 1:
        d[n] += 1
    return list(d.items())


soinsu = prime_factor(n)
kouho = [i * (i + 1) // 2 for i in range(10000)]
ans = 0
for key, val in soinsu:
    pos = bisect_left(kouho, val + 1)
    ans += pos - 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])

  return arr

arr = factorization(int(input()))

ans = 0
for p in arr:
  i = 1
  while p[1] >= i:
    ans += 1
    p[1] -= i
    i += 1
    
print(ans)

Solution (Python):
N = int(input())
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)

    divisors.sort()
    return divisors
def is_prime(n):
    if n == 1:
        return False
    for k in range(2, int(n**0.5) + 1):
        if n % k == 0:
            return False
    return True

def insu(num):
    from collections import defaultdict
    div_prime = [d for d in make_divisors(num) if is_prime(d)]
    res = defaultdict(int)
    for d in div_prime:
        while num % d == 0:
            num //= d
            res[d] += 1
    return res
ins = insu(N)
ans = 0
for v in ins.values():
    counter = 1
    while v >= counter:
        v -= counter
        counter += 1
        ans += 1
print(ans)

Solution (Python):
import math
from collections import defaultdict
from bisect import bisect_right

def trial_division(n):
    factor = defaultdict(int)
    tmp = int(math.sqrt(n)) + 1
    for num in range(2, tmp):
        while n % num == 0:
            n //= num
            factor[num] += 1
    factor[n] += 1
    return factor


n = int(input())
r = trial_division(n)
check = [i for i in range(1, 101)]
for i in range(len(check)-1):
    check[i+1] += check[i]

ans = 0
for k, v in r.items():
    if k == 1:
        continue

    ans += bisect_right(check, v)

print(ans)

Solution (Python):
from math import sqrt,gcd,ceil 
def ii():return int(input())
def mi():return map(float,input().split())
def li():return list(mi())
def si():return input()

n=ii()
ans=0
for i in range(2,int(sqrt(n))+1):
    f=0
    while(n%i==0):
        n//=i
        f+=1
    c=1
    c1=1
    while(c<=f):
        ans+=1
        c1+=1
        c+=c1
if(n>1):
    ans+=1
print(ans)

Solution (Python):
from itertools import accumulate
import bisect

N = int(input())
l = list(accumulate(range(1, 20)))
ans = 0

def prime_decomposition(n):
    i = 2
    table = []
    while i * i <= n:
        while n % i == 0:
            n //= i
            table.append(i)
        i += 1
    if n > 1:
        table.append(n)
    return table

p = prime_decomposition(N)
dic = {}
for v in p:
    if not v in dic:
        dic[v] = 0
    dic[v] += 1

for v in dic.values():
    i = bisect.bisect_right(l, v)
    ans += i

print(ans)

Solution (Python):
n = int(input())
primes = {}
for i in range(2, int(n**0.5)+1):
    if n%i==0:
        cnt = 0
        while n%i==0:
            n //= i
            cnt += 1
        primes[i] = cnt
    if n==1:
        break
else:
    if n!=1:
        primes[n] = 1
ans = 0
for i in primes.values():
    for j in range(1, 100000):
        if j*(j+1)//2<=i:
            ans += 1
        else:
            break
print(ans)

Solution (Python):
from collections import Counter


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


pf = prime_factorize(int(input()))
c = Counter(pf)

ans = 0
for a, b in c.items():
    tmp = 1
    while True:
        b -= tmp
        if b < 0:
            break
        tmp += 1
        ans += 1
print(ans)

Solution (Python):
import sys
import math
input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def li(): return list(input().rstrip())
def debug(*args, sep=" ", end="\n"): print("debug:", *args, file=sys.stderr, sep=sep, end=end) if not __debug__ else None
def exit(*arg): print(*arg); sys.exit()


def make_devisor(n: int):
    x = n
    ret = []
    for i in range(2, int(math.sqrt(n)) + 1):
        cnt = 0
        while x % i == 0:
            cnt += 1
            x //= i
        if cnt != 0:
            ret.append(cnt)
    if x != 1:
        ret.append(1)
    return ret

def main():
    n = ii()
    a = make_devisor(n)
    
    ans = 0
    for x in a:
        t = -1
        while (t + 2) * (t + 1) // 2 <= x:
            t += 1
        ans += t
    print(ans)
    return

if __name__ == "__main__":
    main()

Solution (Python):

def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def s3(n):return [input().split() for _ in range(n)]
def s4(n):return [[x for x in s] for s in s2(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]
def t3(n):return [tuple(int(x) for x in input().split()) for _ in range(n)]
def p0(b,yes="Yes",no="No"): print(yes if b else no)



import itertools


from bisect import bisect_left,bisect_right

n=n0()

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

if n>=2:
    list1=factorization(n)

    list2=[x[1] for x in list1]

    m=max(list2)
    list3=list(itertools.accumulate([i for i in range(1,m+1)]))

    ans=0
    for i in list2:
        a=bisect_right(list3,i)
        ans+=a
    print(ans)
else:
    print(0)

Solution (Python):
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]





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 = ii()

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

f = factorization(N)
ans = 0
for i, j in f:
    cnt = 1
    while True:
        j -= cnt
        ans += 1
        if j <= cnt:
            break
        cnt += 1
print(ans)

Solution (Python):


LI = lambda: list(map(int, input().split()))


N = int(input())


def prime_factor(x):
    m = {}
    i = 2
    while i ** 2 <= x:
        while x % i == 0:
            if i in m:
                m[i] += 1
            else:
                m[i] = 1
            x //= i
        i += 1
    if x != 1:
        m[x] = 1
    return m


def main():
    m = prime_factor(N)
    ans = 0
    for v in m.values():
        n = 1
        while n ** 2 + n <= 2 * v:
            n += 1
        ans += n - 1
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
from functools import lru_cache


def PrimeFactorization(m):
    pf = {}
    for i in range(2, int(m ** 0.5) + 1):
        while m % i == 0:
            pf[i] = pf.get(i, 0) + 1
            m //= i
    if m > 1:
        pf[m] = 1
    return pf


@lru_cache(maxsize=100000)
def f(x):
    return int((-1 + (1 + 8 * x) ** 0.5) // 2 + 0.001)


def resolve():
    n = int(input())
    d = PrimeFactorization(n)
    ans = 0
    for v in d.values():
        ans += f(v)
    print(ans)


if __name__ == '__main__':
    resolve()

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

d = []

x = 2
while n > 1 and x <= 1000000:
    t = 0
    while n % x == 0:
        t += 1
        n //= x
    if t > 0:
        d.append(t)
    x += 1
if n > 1:
    d.append(1)

def f(t):
    l, r = 0, t + 3
    while r - l > 1:
        c = (r + l) // 2
        if c * (c + 1) // 2 > t:
            r = c
        else:
            l = c
    return l
print(sum(f(ti) for ti in d))