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 sys
import math
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())
a=0
if N==1:
  print(0)
  sys.exit()
c = collections.Counter(prime_factorize(N))
L=c.values()
L=list(map(int,L))
for i in range(len(L)):
  q=int(math.sqrt(L[i]))
  for j in range(q,N+1):
    if j*(j+1)//2>L[i]:
      t=(j-1)
      break
    elif j*(j+1)//2==L[i]:
      t=j
      break
  a+=t
print(a)

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 main():
  import collections
  N = int(input())
  if N == 1:
    print(0)
  else:
    K = factorization(N)
    Count = 0
    for i in range(len(K)):
      A = K[i][0]
      B = K[i][1]
      C = 1
      D = 2
      while B >= C:
        C += D
        D += 1
        Count += 1
    print(Count)
main()

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

    return arr
n = int(input())
p = fac(n)
ans = 0
for i in range(len(p)):
    for j in range(1,10001):
        if j*(j-1)/2 <= p[i][1] < j*(j+1)/2:
            ans += j-1
            break
        else:
            continue
print(ans)

Solution (Python):

import numpy as np
from collections import deque
import collections
from collections import defaultdict

import heapq


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
facts = factorization(N)

for fact in facts:
    p = fact[0]
    if (p == 1):
        continue
    num = fact[1]
    if (num == 1):
        
        ans += 1
        continue
    i = 1
    while True:
        
        num = num-i
        if (num < 0):
            break
        else:
            i += 1
    
    ans += (i-1)
print(ans)

Solution (Python):



import sys
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
import math
import bisect
from itertools import accumulate
input = sys.stdin.readline




N = int(input())

def factorization(n):
    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

    return arr

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

d = factorization(N)

max_d = max(d.values())


ref = [i for i in range(1, max_d+1)]
ref = list(accumulate(ref))


ans = 0
for k, v in d.items():
    
    ans += bisect.bisect_right(ref, v)
print(ans)

Solution (Python):

N = int(input())
lis = []
if N == 1:
    print(0)
else:
    n = N
    while n % 2 == 0:
        lis.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            lis.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        lis.append(n)
    
    cnt = 0
    for i in range(1, len(lis)):
        if lis[i] == lis[i-1]:
            cnt +=1
            lis.append(lis[i] ** cnt)
        else:
            cnt = 0
    
    set_lis = set(lis)
    sorted_set = sorted(set_lis)
    
    ans = 0
    for i in range(len(sorted_set)):
        if N % sorted_set[i] == 0:
            N //= sorted_set[i]
            ans += 1 
    print(ans)

Solution (Python):
import sys

import math





input=sys.stdin.readline
n=int(input())
def factorize(n):
    fct={}
    temp=n
    if temp<4:
        fct[temp]=1
    else:
        e=0
        while temp%2==0:
            temp=temp//2
            e+=1
        if e>0:
            fct[2]=e
    
    for b in range(3,int(n**0.5)+1,2):
        e=0
        while temp%b == 0:
            temp=temp//b
            e+=1
        if e>0:
            fct[b]=e
    if temp!=1:
        fct[temp]=1
    return fct

p=factorize(n)
ans=0
if n==1:
  print(0)
  exit()
for d in p.keys():
    e=p[d]
    i=1
    while True:
        if e-i>=0:
            ans+=1
            e-=i
            i+=1
            
        else:
            break
print(ans)

Solution (Python):
import math
import sys
import bisect

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)
  sys.exit()
L=(factorization(N))

L_ans = [1,3,6,10,15,21,28,36,45,55,66,78]
L_2 = [bisect.bisect(L_ans,L[i][1]) for i in range(len(L))]

print(sum(L_2))

Solution (Python):
from collections import Counter
def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct+=b,
        b = b + 1
    if n > 1:
        fct+=n,
    return Counter(fct).values()
a = 0
n = int(input())
if n == 1:exit(print(0))
for i in factorize(n):
  c = s = 0
  while s <= i:
    c += 1
    s = (c+1)*c//2
  a += c - 1
print(a)

Solution (Python):
import bisect




from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product









import sys
sys.setrecursionlimit(10 ** 5 + 10)


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


def resolve():
    N = int(input())

    import math

    

    def make_prime_list_2(num):
        if num < 2:
            return []

        
        prime_list = [i for i in range(num + 1)]
        prime_list[1] = 0  
        num_sqrt = math.sqrt(num)

        for prime in prime_list:
            if prime == 0:
                continue
            if prime > num_sqrt:
                break

            for non_prime in range(2 * prime, num, prime):
                prime_list[non_prime] = 0

        return [prime for prime in prime_list if prime != 0]

    def prime_factorization_2(num):
        """numの素因数分解
        素因数をkeyに乗数をvalueに格納した辞書型dict_counterを返す"""

        if num <= 1:
            
            
            return False
        else:
            num_sqrt = math.floor(math.sqrt(num))
            prime_list = make_prime_list_2(num_sqrt)

            dict_counter = {}  
            

            for prime in prime_list:
                while num % prime == 0:
                    if prime in dict_counter:
                        dict_counter[prime] += 1
                    else:
                        dict_counter[prime] = 1
                    num //= prime
            if num != 1:
                if num in dict_counter:
                    dict_counter[num] += 1
                else:
                    dict_counter[num] = 1

            return dict_counter
    d = prime_factorization_2(N)
    num = [i for i in range(1, 40)]

    
    num = list(accumulate(num))
    cnt = 0
    if not d:
        print(0)
    else:
        for v in d.values():
            cnt += bisect.bisect_right(num, v)
        print(cnt)


resolve()

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

import math

def make_prime_list_2(num):
    if num < 2:
        return []

    
    prime_list = [i for i in range(num + 1)]
    prime_list[1] = 0 
    num_sqrt = math.sqrt(num)

    for prime in prime_list:
        if prime == 0:
            continue
        if prime > num_sqrt:
            break

        for non_prime in range(2 * prime, num, prime):
            prime_list[non_prime] = 0

    return [prime for prime in prime_list if prime != 0]

def prime_factorization_2(num):
    if num <= 1:
        return False
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = make_prime_list_2(num_sqrt)

        dict_counter = {}
        for prime in prime_list:
            while num % prime == 0:
                if prime in dict_counter:
                    dict_counter[prime] += 1
                else:
                    dict_counter[prime] = 1
                num //= prime
        if num != 1:
            if num in dict_counter:
                dict_counter[num] += 1
            else:
                dict_counter[num] = 1

        return dict_counter

l=prime_factorization_2(n)
ans=0

if l==False:pass
else:

    for div,nums in l.items():
        num=nums
        num-=1
        i=2
        while num>=0:
            ans+=1
            num-=i
            i+=1


print(ans)

Solution (Python):
def factrize(x):
    
    f = {}
    tmp = x
    i = 2
    while i**2 <= tmp:
        cnt = 0
        while tmp % i == 0:
            cnt += 1
            tmp = tmp // i
        if cnt > 0:
            f[i] = cnt
        i += 1
    if tmp != 1 or f == {}:
        f[tmp] = 1
    return f


C = []
c = 0
for i in range(50):
    if i in (1, 3, 6, 10, 15, 21, 28, 36, 45):
        c += 1
    C.append(c)

n = int(input())
if n == 1:
    print(0)
else:
    f = factrize(n)
    ans = 0
    for i in f.keys():
        ans += C[f[i]]
    print(ans)

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

output = 0
for k, v in c.items():
    num = 1
    cnt = 0
    while num <= v:
        cnt += 1
        v -= num
        num += 1
    output += cnt
    
print(output)

Solution (Python):
n=int(input())
def prime_factorize(n):
    a=[]
    while n%2==0:
        a.append(2)
        n//=2
    f=3
    while f**2<=n:
        if n%f==0:
            a.append(f)
            n//=f
        else:
            f+=2
    if n!=1:
        a.append(n)
    return(a)
import collections
A=collections.Counter(prime_factorize(n))
ans=0
import math
for v in A.values():
    x=math.floor(v**0.5)
    while x*(x+1)<=v*2:
        x+=1
    ans+=x-1
print(ans)

Solution (Python):
from collections import defaultdict
import math
dt = defaultdict(int)
def primeFactors(n): 
      
    while n % 2 == 0: 
        dt[2]+=1 
        n = n // 2
    for i in range(3,int(math.sqrt(n))+1,2): 
          
        while n % i== 0: 
            dt[i]+=1 
            n = n //i 
              
    if n > 2: 
        dt[n]+=1
def how(n):
    i=1 
    while (i*(i+1))//2 <= n:
        i+=1 
    i-=1
    return i
        
n = int(input())
primeFactors(n)
ans = 0 

for key in dt.keys():
    ans+= how(dt[key])
    
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

divs = factorization(N)

n = len(divs)
ans = 0

for i in range(n):
    div,num = divs[i]
    cnt = 0
    now = 1
    while 1:
        if num >= now:
            num -= now
            now += 1
            cnt += 1
        else:
            break
    ans += cnt
if N == 1:
    print(0)
    exit()
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)
    exit()
pfs = factorization(n)

cs = 0
for p, f in pfs:
    c = 0
    for i in range(10**12):
        f -= i
        if f < 0:
            c = i-1
            break
    
    cs += c
print(cs)

Solution (Python):


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

N = int(input())
if N == 1:
    print(0)
else:
    L = factorize(N)
    count = 0
    for a in L:
        i = 1
        while True:
            a[1] = a[1] - i
            if a[1] < 0:
                break
            else:
                count += 1
                i += 1
    print(count)

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

count = 0
trial = factorization(n)
for i in range(len(trial)):
    p = 1
    while trial[i][1] > 0:
        trial[i][1] -= p
        p += 1
        if trial[i][1] >= 0:
            count += 1

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

Solution (Python):
def prime_factorize(n):
    a = []
    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
            a.append([i, cnt])
    if tmp != 1:
        a.append([tmp, 1])
    if not len(a) and n != 1:
        a.append([n, 1])
    return a


N = int(input())

ans = prime_factorize(N)
count = 0
for ls in ans:
    target = ls[1]
    tmp = 1
    while True:
        if target - tmp >= 0:
            target = target - tmp
            tmp += 1
            count += 1
        else:
            break
print(count)

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 renzoku(n):
    i = 0
    while n - (i+1) >= 0:
        n = n-(i+1)
        i += 1
    return i
      
N = int(input())
if N == 1:
  print("0")
  sys.exit()
oriN = N*1
A = factorization(N)

M = len(A)

ans = 0
for i in range(M):
  temp = A[i][1]
  f = renzoku(temp)
  ans += f
print(ans)

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

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


prime = prime_factor(n)

c = Counter(prime)
count = 0
already = []
for p in prime:
    if p not in already:
        already.append(p)
        x = c[p]
        i = 1
        while x >= i:
            x -= i
            i += 1
            count += 1

print(count)

Solution (Python):
from collections import Counter as ct

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

res = ct(res)
cnt = 0
for i in res.values():
    tmp = 1
    for j in range(1, i + 1):
        i -= j
        if i >= 0:
            cnt += 1
        else:
            break
print(cnt)

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))
sosu = list(c.values())
answer = 0
for i in range(len(sosu)):
    if sosu[i]==1:
        answer += 1
    else:
        answer += int(-1/2+((1+8*(sosu[i]))**(1/2))/2)
print(answer)

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())
bunkai = factorization(n)
ans = 0
for i in bunkai:
    a = i[1]
    b = 1
    cnt = 0
    while a > 0:
        a -= b
        b += 1
        if a >= 0:
            cnt += 1
        else:
            pass
    ans += cnt
if n == 1:
    print(0)
else:
    print(ans)

Solution (Python):
def main():
    A = int(input())
    T = prime_decomposition(A)
    TV = list(set(T))
    cnt = 0
    
    
    

    for d in TV:
        D = T.count(d)
        cc = 0
        while True:
            cc +=1
            if D >=cc:
                D-=cc
                cnt +=1
            else:
                break

    print(cnt)




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

if __name__ == '__main__':
    main()

Solution (Python):
"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""

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

fact = factorization(N)

ans = 0

for _,i in fact:
    cnt = 0
    j = 0
    while(True):
        if(cnt + j + 1 > i ):
            ans += j
            break
        j += 1
        cnt += j 
        
print(ans)

Solution (Python):
from collections import defaultdict as dd
from math import sqrt
d=dd(int)
def pr(n): 
    while n % 2 == 0:
        d[2]+=1
        n = n / 2
    for i in range(3,int(sqrt(n))+1,2): 
        while n % i== 0: 
            d[i]+=1
            n = n / i 
    if n > 2: 
        d[n]+=1

n=int(input())
pr(n)
ans=0
for i in d:
    ans+=(sqrt(1+8*d[i])-1)//2
print(int(ans))

Solution (Python):
N=int(input())
l=[1,3,6,10,15,21,28,36,45]
a=0
for i in range(2,1000001):
    t=0
    while N%i==0:
        t+=1
        N//=i
    if t:
        for i in range(9):
            if t<l[i]:
                a+=i
                break
if N>1000000:
    a+=1
print(a)

Solution (Python):
def div(c,n):
    d={}
    while(n%2==0):
        n=n//2
        if(2 in d):
            d[2]+=1
        else:
            d[2]=1
    for i in range(3,int(n**0.5)+1):
        while(n%i==0):
            n=n//i
            if(i in d):
                d[i]+=1
            else:
                d[i]=1
    if(n>1):
      d[n]=1
      if(n==c):
          return 1
    su=0
    for i in d:
        f=d[i]*2
        su+=(-1+(int((1+4*f)**0.5)))//(2)
    return su
            
n=int(input())
c=n
print(div(c,n))

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 collections

n=int(input())

x=prime_factorize(n)
x=collections.Counter(x)
x=x.most_common()
ans=0

for i in range(len(x)):
    v=0
    for j in range(1,31):
        v+=j
        if x[i][1]>=v:
            ans+=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])

    return arr

fact = factorization(N)
s = 0
for p, e in fact:
    s += int(pow(e * 2 + 0.25, 0.5) - 0.5)
print(s)

Solution (Python):


import sys
import math
import collections
import itertools
import bisect
INF = 10 ** 13
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return x if y == 0 else gcd(y, x%y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def LS() : return input().split()
def RS(N) : return [input() for _ in range(N)]
def LRS(N) : return [input().split() for _ in range(N)]
def PL(L) : print(*L, sep="\n")
def YesNo(B) : print("Yes" if B else "No")
def YESNO(B) : print("YES" if B else "NO")

def prime_factorize(N):
    res = []
    for i in range(2, int(math.sqrt(N)) + 1):
        if N % i != 0:
            continue

        num = 0
        while N % i == 0:
            N /= i
            num += 1
        
        res.append([i, num])

    if N != 1:
        res.append([N, 1])

    return res


N = I()
P = prime_factorize(N)

ans = 0
for p in P:
    p = p[1]
    tmp = 0

    for i in range(1, 10**12):
        if p >= i:
            p -= i
            tmp += 1
        else:
            break
    
    ans += tmp

print(ans)

Solution (Python):
def mp(): return map(int, input().split())
def lmp(): return list(map(int, input().split()))


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

u = factorization(n)
ans = 0
if n == 1:
    print(0)
    exit()
for i in range(len(u)):
    tar = u[i][1]
    c = 0
    t = 0
    while True:
        if c+t+1 > tar:
            break
        t += 1
        c += t
    ans += t
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

ans = 0

for p,e in factorization(n):
    tmp = 1
    for i in range(2,60):
        tmp += i
        if e < tmp:
            ans += i-1
            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
A = int(input())

if A == 1:
    print(0)
else:
    ls = factorization(int(A)) 
    ans = 0
    for n in range(len(ls)):
        ans += int((ls[n][1]*2 +1/4)**(1/2)-(1/2))
    print(ans)

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

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

prefix=[1]*40
for i in range(1,40):
    prefix[i]=prefix[i-1]+i+1

ans=0
prime_table=prime_decomposition(n)
i=0
while i <len(prime_table):
    length=1
    while i<len(prime_table)-1 and prime_table[i+1]==prime_table[i]:
        length+=1
        i+=1
    i+=1
    for j in range(40):
        if prefix[j]>length:
            break
    ans+=j
print(ans)

Solution (Python):
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 prime_factorize(n):
    a=[]
    while n%2==0:
        a.append(2)
        n //=2
    f=3
    while f**2<=n:
        if n%f==0:
            a.append(f)
            n //=f
        else:f +=2
    if n!=1:a.append(n)
    return a


n=int(input())
prime=make_divisors(n)
prime=[i for i in prime if len(set(prime_factorize(i)))==1]
A=set()
for i in prime:
    if i==1:continue
    num,e=i,1
    while num<=n:
        A.add(num)
        e +=1
        num=i**e
cnt=0
for i in sorted(A):
    if n%i==0:
        cnt +=1
        n //=i
print(cnt)

Solution (Python):
N=int(input())
munou=[]
count=0
sumi=set()
if N==1:
    print(0)
    exit()
def factorization(n):
    def sieve(n):
        is_prime = [True for _ in range(n+1)]
        is_prime[0] = False

        for i in range(2, n+1):
            if is_prime[i-1]:
                j = 2 * i
                while j <= n:
                    is_prime[j-1] = False
                    j += i
        table = [ i for i in range(1, n+1) if is_prime[i-1]]
        return table
    arr = []
    temp = n
    for i in sieve(int(n**0.5)):
        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
kari=factorization(N)
for i in range(len(kari)):
    for j in range(1,kari[i][1]+1):
        z=kari[i][0]**j
        if N%z==0 and z not in sumi:
            sumi.add(z)
            N=N/z
            count+=1
print(count)

Solution (Python):
import sys

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


def aiueo(e):
    i = 1
    Sum = 3
    while Sum <= e:
        i += 1
        Sum += i+1

    return i

hoge1 = prime_factorize(N)
hoge2 = list(set(hoge1))

num = 0
for i in range(len(hoge2)):
    a = hoge1.count(hoge2[i])
    num += aiueo(a)
    

print(num)

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 solve(N):
    fact = factorization(N)
    ans = 0

    if N == 1:
        print(0)
        return

    for f in fact:
        s, c = f
        i = 1
        while True:
            if c >= i:
                c -= i
                ans += 1
            else:
                break
            i += 1
    print(ans)


if __name__ == '__main__':
    N = int(input())
    solve(N)

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

fact = factorization(N)
ans = 0
for _, y in fact:
    for i in range(y):
        y -= i+1
        ans += 1
        if y < i+2:
            break

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
N = int(input())
import collections
import math
lst = prime_factorize(N)
c = collections.Counter(lst)
count = 0
for _, n in c.items():
    x = (-1+math.sqrt(1+8*n))//2
    count += x
print(int(count))

Solution (Python):
import math
n = int(input())
lis = []
for i in range(2,math.ceil(math.sqrt(n))+1):
    cnt = 0
    while n % i == 0:
        n //= i
        cnt += 1
    if cnt:lis.append(cnt)
if n != 1:
    lis.append(1)
ans = 0

if lis == []:
    if n == 1:
        print(0)
        exit()
    else:
        print(1)
        exit()
for num in lis:
    go = 1
    while num >= go:
        ans += 1
        num -= go
        go += 1
print(ans)

Solution (Python):

from collections import Counter
import math

def make_prime_list(N):
    prime_list = [2]
    for i in range(3,int(N**0.5)+1,2):
        flag = True
        for j in range(3,int(i**0.5)+1):
            if i % j == 0:
                flag = False
                break
        if flag:
            prime_list.append(i)
    return prime_list

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())
    C = Counter(prime_factorize(N))
    
    ans = 0
    for c in C.values():
        tmp = c
        i = 1
        while tmp >= i:
            tmp -= i
            ans += 1
            i += 1
    print(ans)


if __name__ == "__main__":
    main()