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):
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())
if n == 1:
  ans = 0
else:
  ans = 0
  a = factorization(n)
  for j in a:
    t = j[1]
    if t <= 2:
      ans += 1
    elif t <= 5:
      ans += 2
    elif t <= 9:
      ans += 3
    elif t <= 14:
      ans += 4
    elif t <= 20:
      ans += 5
    elif t <= 27:
      ans += 6
    elif t <= 35:
      ans += 7
    else:
      ans += 8
print(ans)

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

n=10**6

prime = {i for i in range(2,n)}
for i in range(2,n):
    if i in prime:
        for j in range(i*2,n,i):
            if j in prime:
                prime.remove(j)
from collections import defaultdict
def prime_factorization(N):
    dic=defaultdict(int)
    for some in prime:
        if N%some==0:
            while N%some==0:
                N=N//some
                dic[some]+=1
        else:
            pass
    if N!=1:
        dic[N]=1
    return dic
ans=0
K=prime_factorization(N)
import bisect
H=[i*(i-1)//2 for i in range(10**4)]

for value in K.values():
    ans+=bisect.bisect_right(H,value)-2
print(ans)

Solution (Python):
n = int(input())
def prime(n):
    p = []
    flag = [True] * (n - 1)
    for i in range(n - 1):
        if flag[i] == True:
            p.append(i + 2)
            num = i
            while num <= n - 2:
                flag[num] = False
                num += i + 2
    return p
p =prime(int(n ** 0.5 + 1))
p2 = {}
for i in p:
    while True:
        if n % i == 0:
            p2.setdefault(i, 0)
            p2[i] += 1
            n //= i
        else:
            break
if n != 1:
    p2[n] = 1
if not p2:
    print(0)
else:
    ans = 0
    for i in p2.values():
        num = 1
        while i >= num:
            ans += 1
            i -= num
            num += 1
    print(ans)

Solution (Python):
from collections import Counter
N = int(input())

def prime_factorization(n):
    table = []
    for x in range(2, int(n ** 0.5) + 1):
        while n % x == 0:
            table.append(x)
            n //= x
    if n > 1:
        table.append(n)
    return table


T = prime_factorization(N)
C = Counter(T)

ans = 0
for v in C.values():
    nx = 1
    while v >= nx:
        v -= nx
        ans += 1
        nx += 1

print(ans)

Solution (Python):
import math
n=int(input())
tmp = int(math.sqrt(n)) + 1
ans=0
for num in range(2,tmp):
  count=0
  while n % num == 0:
    n //= num
    count+=1
  ans+=int(math.sqrt(2*count+0.25)-0.5)
if n!=1:
  ans+=1
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
import collections
N = int(input())
tmp = prime_factorize(N)
C = collections.Counter(tmp)
S = set()
for k, v in C.items():
    for i in range(v):
        S.add(k**(i+1))
ans = 0
for s in sorted(S):
    if N%s == 0:
        N = N//s
        ans += 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
for p,c in factorization(N):
    if p==1:
        continue
    n=1

    while n*(n+1)<=2*c:
        n+=1
    n-=1
    ans+=n

print(ans)

Solution (Python):
from math import sqrt
from collections import defaultdict

N = int(input())

f = defaultdict(int)
for p in [2] + list(range(3, int(sqrt(N)) + 1, 2)):
    while N % p == 0:
        N //= p
        f[p] += 1
    if N == 1:
        break
if N != 1:
    f[N] += 1

ans = 0
for e in f.values():
    ans += int((sqrt(1 + 8 * e) - 1) / 2)
print(ans)

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

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

if N > 1:
  p_dic[N] = 1
  
def foo(x):
  r = 0
  base = 1
  while x >= base:
    x -= base
    r+=1
    base += 1
  return r

ans = 0
for v in p_dic.values():

  ans += foo(v)

print(ans)

Solution (Python):
from collections import defaultdict
n = int(input())

arr = defaultdict(int)
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[i] = cnt

if temp!=1:
    arr[temp] = 1

if arr==[]:
    arr[n] = 1

ans = 0

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

Solution (Python):
I = lambda:list(map(int,input().split()))
n,=I()
k=int(n**0.5)
i=2;l=[]
while i<=k and n>1:
  c=0
  while n%i==0:
    n//=i;c+=1
  if c!=0:
    l.append(c)
  i+=1
if n!=1:
  l.append(1)
an=0
for i in l:
  d=int((2*i)**0.5)
  x=d if (d*d+d)//2<=i else d-1
  an+=x
print(an)

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

n=int(input())
c=collections.Counter(prime_factorize(n))
ans=0
for x in c:
    num=c[x]
    for i in range(1,num+2):
        if i*(i+1)/2>num:
            ans+=i-1
            break
print(ans)

Solution (Python):
import sys, math,os
from io import BytesIO, IOBase


from collections import defaultdict as dd, deque, Counter

def data(): return sys.stdin.readline().strip()
def mdata(): return list(map(Decimal, data().split()))
def outl(var) : sys.stdout.write(' '.join(map(str, var))+'\n')
def out(var) : sys.stdout.write(str(var)+'\n')
sys.setrecursionlimit(100000)
INF = float('inf')
mod = int(1e9)+7
from decimal import Decimal


def main():

    n=int(data())
    cnt=0
    i=2
    while i<(int(n**0.5)+1):
        if n%i==0:
            t=i
            while n%t==0:
                cnt+=1
                n//=t
                t*=i
            t//=i
            while t>1:
                if n%t==0:
                    n//=t
                else:
                    t//=i
        i+=1
    if n!=1:
        cnt+=1
    out(cnt)


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
def factorization(n):
    D = {}
    a = n
    p = 2
    while a != 1:
        cnt = 0
        while a % p == 0:
            cnt += 1
            a //= p
        if cnt != 0:
            D[p] = cnt
        p += 1
        if p * p > n and a != 1:
            D[a] = 1
            break
    return D
f = factorization(N)
X = [0 for _ in range(101)]
for i in range(101):
    X[i] = i*(i+1)//2
p = 0
for i in f:
    x = f[i]
    for j in range(100):
        if X[j] <= x < X[j+1]:
            p += j
            f[i] -= X[j]
            break
print(p)

Solution (Python):
import sys
import math
def input():
    return sys.stdin.readline()[:-1]

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(cnt)

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

    if arr==[]:
        arr.append(1)
    return arr

li = factorization(n)
if n==1:
    print(0)
else:
    cnt = 0
    for x in li:
        cnt += math.floor((math.sqrt(1+8*x)-1)/2)
    print(cnt)

Solution (Python):
n=int(input())
if n==1:
    print(0)
    exit()
d=dict()
for i in range(2,int(n**0.5)+1):
    while n%i==0:
        n//=i
        if i in d:
            d[i]+=1
        else:
            d[i]=1
if n!=1:
    d[n]=1

p=0
for i in d.values():
    e=0
    j=1
    while True:
        e+=j
        p+=1
        
        j+=1
        if e>i:
            p-=1
            break
print(p)

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

prime = list()

i = 2
while i * i <= n:
  if n % i == 0:
    cnt = 0
    while n % i == 0:
      cnt += 1
      n //= i
    prime.append(cnt)
  i += 1
  
if n != 1:
  prime.append(1)
  
ans = 0
for x in prime:
  a = 1
  while a * (a+1) // 2 <= x:
    a += 1
  ans += a-1
  
print(ans)

Solution (Python):
from math import sqrt

N = int(input())

res = 0
for i in range(2, int(sqrt(N)) + 1):
    a = set()
    b = 1
    while True:
        if N % i == 0:
            N = N // i
            b *= i
            if b not in a:
                a.add(b)
                res += 1
                b = 1
        else:
            break

if N != 1:
    res += 1

print(res)

Solution (Python):
from sys import stdin
from sys import setrecursionlimit
import math
from collections import Counter
setrecursionlimit(10 ** 7)

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

li = Counter(prime_factorize(n))
count = li.items()

now = 0
lis = []
for i in range(1000):
    lis.append(now+i)
    now += i

lis = lis[1:]

import bisect
point = 0
for i in count:
    a,b = i
    point += bisect.bisect_right(lis,b)

print(point)

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

P=factorization(N)
ans=0
for i in range(len(P)):
    k=P[i][1]
    c=1
    while k>0:
        ans+=1
        k-=c
        c+=1
        if k<0:
            ans-=1

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

Solution (Python):
import numpy as np
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


soi = factorization(n)

ans = 0

for fac in soi:
    if fac[0] == 1:
        break
    num = 1
    rem = fac[1]
    while 1:
        if rem >= num:
            ans += 1
            rem -= num
            num += 1
        else:
            break

print(ans)

Solution (Python):

import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

U = 10 ** 7 + 10
is_prime = np.zeros(U, np.bool)
is_prime[2] = 1
is_prime[3::2] = 1
for p in range(3, U, 2):
    if p*p > U:
        break
    if is_prime[p]:
        is_prime[p*p::p+p] = 0

M = 10 ** 6
small_primes = np.where(is_prime[:M])[0].tolist()

N = ir()
answer = 0
used = set([1])
for p in small_primes:
    d = p
    while N%d == 0:
        answer += 1
        N //= d
        used.add(d)
        d *= p
    while N%p == 0:
        N //= p

if N > 1 and N not in used:
    answer += 1

print(answer)

Solution (Python):

import sys

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: int):
    
    factors = factorization(N)
    r = 0
    for p,e in factors:
        if p == 1: continue
        
        c = 1
        while c <= e:
            r += 1
            e -= c
            c += 1
    print(r)



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())
if n==1:
  print(0)
  exit()
def fac(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
su = 0

for j,k in fac(n):
  n = int(0.5*(-1+(1+8*k)**0.5))
  su += n
 
print(su)

Solution (Python):
def prime(n,p):
    iteral = 0
    while n%p == 0:
        n //= p
        iteral += 1
    return iteral,n
def ok(n,target):
    if n*(n+1)//2<=target<(n+1)*(n+2)//2:return True
    else:
        return False
N = int(input())
from collections import defaultdict
d = defaultdict(int)
for i in range(2,int(N**0.5)):
    if N%i==0:
        t,N = prime(N,i)
        d[i] = t
if N != 1:
    d[N] = 1
ans = 0
for n in d:
    k = 1
    while not ok(k,d[n]):
        k += 1
    ans += k

print(ans)

Solution (Python):

def prime_decomposition(n):
    i = 2
    prime2exponent = {}  
    while i*i <= n:
        while n % i == 0:
            n //= i
            if i in prime2exponent:
                prime2exponent[i] += 1
            else:
                prime2exponent[i] = 1
        i += 1
    if n > 1:
        if n in prime2exponent:
            prime2exponent[n] += 1
        else:
            prime2exponent[n] = 1
    return prime2exponent

N = int(input())
p2e = prime_decomposition(N)


def calc_elem(n):
    res = 1
    while res * (res + 1) // 2 <= n:
        if (res+1)*(res+2)//2 > n:
            break
        else:
            res += 1
    return res

ans = 0
for v in p2e.values():
    ans += calc_elem(v)
print(ans)

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10, gcd
from itertools import permutations, combinations, product, accumulate, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 1, 0, -1, 1, -1, -1, 1]
dy = [1, 0, -1, 0, 1, -1, 1, -1]
debugmode = True


def prime_factorize(n):
    a = []
    a.append(1)
    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)
    
    b = [[],[]]
    cnt = 1
    for i in range(len(a)+1):
        if i > 0 and i < len(a):
            if a[i] == a[i-1]:
                cnt += 1
            else:
                b[0].append(a[i-1])
                b[1].append(cnt)
                cnt = 1
        if i == len(a) and i > 0:
            b[0].append(a[i-1])
            b[1].append(cnt)
        elif i == len(a) and i == 0:
            b[0].append(a[i])
            b[1].append(cnt)
    return b

n = INT()
a = prime_factorize(n)
ans = 0
for i in range(1, len(a[0])):
    
    ans += int(sqrt(1 + 8 * a[1][i]) - 1) // 2
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

def support(n):
    counter = 0
    temp = 1
    while n - temp >= 0:
        n -= temp
        temp += 1
        counter += 1
    return counter

def main():
    n = int(input())
    factors_counter = Counter(prime_factorize(n))
    answer = 0
    for factor in factors_counter.keys():
        factor_count =factors_counter[factor]
        answer += support(factor_count)
    print(answer)





if __name__ == '__main__':
    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
    
ans = 0

n = int(input())

x = factorization(n)

for i in x:
    cnt = 0
    k = 1
    while i[1]>=k:
        cnt += 1
        k += (cnt+1)
    ans += cnt
    
if n == 1:
    ans = 0
    
print(ans)

Solution (Python):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n = ni()

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

from collections import Counter
import bisect

c = Counter(res)

tt = [i for i in range(1,60)]
for j in range(1,len(tt)):
    tt[j] += tt[j-1]

ans = 0
for v in c.values():
    ans += bisect.bisect_right(tt,v)

print(ans)

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

    if N == 1:
        print(0)
        return

    M = N

    ps = []

    d = 2
    cnt = 0
    while N % d == 0:
        N //= d
        cnt += 1
    if cnt:
        ps.append(cnt)
        

    d = 3
    while d * d <= M:
        cnt = 0
        while N % d == 0:
            N //= d
            cnt += 1
        if cnt:
            ps.append(cnt)
            
        d += 2

    if N > 1:
        ps.append(1)
        

    ans = 0
    for x in ps:
        t = 1
        while x >= t:
            x -= t
            t += 1
            ans += 1
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
from collections import defaultdict

n = int(input())
dd = defaultdict(int)
for i in range(2, int(n ** (1 / 2) + 2)):
    while n % i == 0:
        dd[i] += 1
        n //= i
if n != 1:
    dd[n] += 1
ans = 0
cnt = {}
for i in range(20):
    tmp = i * (i + 1) // 2
    cnt[tmp] = i
for i, j in dd.items():
    for num in cnt:
        if j >= num:
            continue
        ans += cnt[num] - 1
        break
print(ans)

Solution (Python):
from math import sqrt

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

f = factorization(n)
ans = 0
for p in f:
    ans += (-1 + int(sqrt(1 + 8 * p[1]))) // 2
print(ans)

Solution (Python):
import numpy as np


def solve(n):
    
    primes = np.ones(10 ** 6 + 1, dtype=int)
    primes[:2] = 0
    for p in range(2, 10 ** 6 + 1):
        if primes[p]:
            primes[p * p::p] = 0

    res = 0
    for p in range(10 ** 6 + 1):
        if primes[p] and n % p == 0:
            c = 0
            while n % p == 0:
                n = n // p
                c += 1
            d = 1
            while c >= d:
                c -= d
                res += 1
                d += 1
    if n > 1:
        res += 1

    return res


def main():
    n = int(input())
    res = solve(n)
    print(res)


def test():
    assert solve(24) == 3
    assert solve(1) == 0
    assert solve(64) == 3
    
    


if __name__ == "__main__":
    test()
    main()

Solution (Python):
from collections import defaultdict

def prime_factors(n):
    d = defaultdict(int)
    while n%2 == 0:
        d[2] += 1
        n //= 2
    i = 3
    while i*i <= n:
        while n%i == 0:
            d[i] += 1
            n //= i
        i += 2
    if n > 2:
        d[n] += 1
    return d

N = int(input())
ans = 0
done = set()

for k,v in prime_factors(N).items():
    p = 0
    while v > 0:
        p += 1
        v -= 1
        if not pow(k, p) in done:
            ans += 1
            done.add(pow(k, p))
            p = 0
print(ans)

Solution (Python):
N=int(input())
if N==1:
    print(0)
else:
    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

    A=factorization(N)
    total=0
    for i in range(len(A)):
        for j in range(1,10**6):
            if j*(j+1)//2<=A[i][1]<(j+1)*(j+2)//2:
                total+=j
                break
    print(total)

Solution (Python):
N = int(input())
if N == 1:
    print(0)
    quit()
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 sousa(n):
    x = [1,3,6,10,15,21,28,36,45,55]
    for i in range(10):
        a = x[i]
        if n < a:
            return i
            break
bunkai = factorization(N)
ans = 0
for i in range(len(bunkai)):
    c = bunkai[i][1]
    ans += sousa(c)
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 f(N):
    if N == 1: return 0
    fact = factorization(N)
    ans = 0
    count_list = [0]
    for i in range(100):
        for j in range(i+2):
            count_list.append(i+1)
    for k, count in fact:
        ans += count_list[count]
    return ans

def main():
    N = int(input())
    print(f(N))

if __name__ == "__main__":
    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())

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

s = factorization(n)
ans = 0

for i in s:
    cnt = 1
    tmp = i[1]
    while tmp > 0:
        tmp -= cnt
        if tmp >= 0:
            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])
    if arr == []:
        arr.append([n, 1])
    return arr

n = int(input())
nn = factorization(n)

ans = 0

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

for i in range(len(nn)):
    ans += 1
    cnt = 1
    dif = 2
    cnt += dif
    while cnt <= nn[i][1]:
        ans += 1
        dif += 1
        cnt += dif
print(ans)

Solution (Python):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))

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()
A = factorization(n)

ans = 0
if n == 1:
    print(0)
else:
    for i in A:
        num = i[1]
        cnt = 0
        while  num-cnt > 0:
            cnt += 1
            num -= cnt
        ans += cnt
    print(ans)

Solution (Python):
from collections import defaultdict


def factorize(n):
    facts = defaultdict(int)
    while n % 2 == 0:
        n //= 2
        facts[2] += 1
    m = 3
    while m * m <= n:
        while n % m == 0:
            facts[m] += 1
            n //= m
        m += 2
    if 1 < n:
        facts[n] += 1
    return facts


N = int(input())

ans = 0
facts = factorize(N)
for num in facts.values():
    for i in range(1, num + 1):
        if i <= num:
            num -= i
            ans += 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())
if N==1:
    print(0)
elif N==2:
    print(1)
else:
    f = factorization(N)
    
    
    ans=0
    for elem in f:
        t = elem[1]
        for i in range(1,N):
            if (i*(i+1)//2)>t:
                break
        
        ans += (i-1)
        
    print(ans)

Solution (Python):
import collections
import math

N = int(input())

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(int(n))
    return table


def aaa(num):
    tmp = (math.sqrt(8*num+1)-1)/2
    t = math.floor(tmp)
    return t


c = collections.Counter(prime_decomposition(N))


ans = 0
d = list(c.values())

for i in range(len(d)):
    if d[i] == 1:
        ans += 1
    else:
        ans += aaa(d[i])
        
print(ans)

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

def prime_fact(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  

ps = prime_fact(n)
current = 0
num = 0
tmp_c = 0
cnt = 0
if ps:
  for i in range(len(ps)):
    if ps[i] != current:
      num = 2
      tmp_c = 0
      cnt += 1
      current = ps[i]
    else:
      tmp_c += 1
      if tmp_c == num:
        cnt += 1
        tmp_c = 0
        num += 1
  print(cnt)
else:
  print(0)

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
arr = factorization(n)
ans = 0
if arr==[[1,1]]:
    print(0)
else:
    suretsu = [1,3,6,10,15,21,28,36,45]
    import bisect
    for i in arr:
        ans += bisect.bisect_right(suretsu,i[1])
    print(ans)

Solution (Python):
import bisect

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


l = factorization(N)

a = [i * (i + 1) // 2 for i in range(2 * 10**6)]
ans = 0


for p in l:
    n = bisect.bisect_right(a, p[1]) - 1
    ans += n

print(ans)

Solution (Python):
from collections import defaultdict

D = defaultdict(int)

N = int(input())

x = N
y = 2
while y*y <= x:
    while x % y == 0:
        D[y] += 1
        x //= y
    y += 1
if x > 1:
    D[x] += 1

res = 0
for k, v in D.items():
    i = 1
    c = 0
    v -= 1
    while v >= 0:
        c += 1
        i += 1
        v -= i
    res += c

print(res)

Solution (Python):
import sys

def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))
def prime_factor(n):
    """Return a list of prime factorization numbers of n"""
    res = []
    for i in range(2,int(n**0.5)+1):
        while n%i==0: res.append(i); n //= i
    if n != 1: res.append(n)
    return res
from collections import Counter

def main():
    n = II()
    p = prime_factor(n)
    c = Counter(p)
    cnt = 0
    for ci in c.values():
        t = ci
        i = 1
        while t >= i:
            t -= i
            i += 1
            cnt += 1
    print(cnt)


if __name__ == '__main__':
    main()