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

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 i in c.items():
  num = i[1]
  temp = 1
  while True:
    num -= temp
    if num < 0:
      break
    ans += 1
    temp += 1

print(ans)

Solution (Python):
import numpy as np
import collections

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

c = collections.Counter(prime_factorize(n))

ans = 0
for num in c:
    cnt= 1
    total = 2
    while c[num] >= cnt:
        cnt += total
        total += 1
        ans += 1


print(ans)

Solution (Python):
import math


def primefac(x):
    fac = []
    for i in range(2, int(math.sqrt(x)) + 1 + 1):
        if x % i != 0:
            continue
        ex = 0
        while x % i == 0:
            ex += 1
            x = x // i
        fac.append((i, ex))

    if x != 1:
        fac.append((x, 1))
    return fac


def ans(fac):
    count = 0
    for _, ex in fac:
        for i in range(1, 10 ** 12):
            ex -= i
            if ex < 0:
                break
            else:
                count += 1
    return count


if __name__ == "__main__":
    N = int(input())
    fac = primefac(N)
    
    print(ans(fac))

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

c = collections.Counter(prime_factorize(N))
kiso = [1]
for i in range(2, 10):
    kiso.append(kiso[i-2]+i)
d = dict()
k = 1
for i in range(1, 46):
    if i in kiso and i != 1:
        k += 1
    d[i] = k

ans = 0
for n in c:
    ans += d[c[n]]

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

plist = prime_factorize(n)

import collections
c = collections.Counter(plist)


cnt=0
for k,v in c.items():
    cnt2=0
    idx=0
    while True:
        idx+=1
        cnt2+=idx
        if cnt2 > v:
            break
        else:
            cnt+=1


print(cnt)

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())
line = factorization(n)
m = len(line)
ans = 0
for i in range(m):
    power = line[i][1]
    j = 1
    while power > 0:
        power -= j
        if power < 0:
            break
        j += 1
        ans += 1

if n == 1:
    print(0)
else:
    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

if n == 1:
    print(0)
else:
    f = factorization(n)
    result = 0
    for each in f:
        shisu = each[1]
        counter = 1
        while shisu >= counter and shisu >= 0:
            shisu -= counter
            counter += 1
            result += 1
    print(result)

Solution (Python):


import sys
import math
import time

import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools



sys.setrecursionlimit(10**7)






N = int(input())
ans = 0

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)



for i in A:
    for j in range(1, 10**12):
        if(i[1]<j*(j+1)//2):
            ans += j-1
            break
if(N == 1):
    print(0)
else:
    print(ans)

Solution (Python):

K = int(input())

N = 10**6
dp = [1] * (N+1)
dp[0] =  dp[1] =  0

def pw(j,i):
    while(j%i==0):
        j //= i
        
    if j == 1:
        return True
    else:
        return False

for i in range(2,N+1):
    if dp[i]:
        for j in range(i*i, N+1, i):
            
            dp[j] = 0
ans = 0
for n in range(N):
    i = 0
    while(1):
        i+=1
        v = pow(n,i)
        if (dp[n] == 1 and K%v==0):
            K //= v
            ans += 1
        else:
            break

for n in range(N):
    while(dp[n] == 1 and K%n==0):
        K //= n


if K!=1:
    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

l=factorization(n)
cnt=0

if n==1:
    print(0)
else:
    for num,i in l:
        p=1
        while i>0:
            cnt+=1
            i-=p
            p+=1
            if i<p:
                break
    print(cnt)

Solution (Python):
import collections

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 nannko(s):
  i = 1
  while s > i-1:
    s -= i
    i +=1
  return i-1

c = collections.Counter(prime_factorize(n))
kosuu = list(c.values())

ans = 0
for i in kosuu:
  ans += nannko(i)

print(ans)

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
p = prime_factorize(n)

import collections
cnt = collections.Counter(p)

ans = 0
for pi, ci in cnt.items():
    num = 1
    for i in range(1, 10000):
        if (i * (i+1))//2 <= ci:
            num = i
        if (i * (i+1))//2 > ci:
            break
    ans += num

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

if N == 1:
    ans = 0
else:
    ans = 0
    checked = set()
    fact = factorization(N)
    candidates = []
    for num in fact:
        for i in range(1,num[1]+1):
            candidates.append(num[0]**i)

    candidates.sort(reverse=True)
    
    while N != 1 and len(candidates) > 0:
        
        while len(candidates) != 0:
            tmp = candidates.pop()
            if N%tmp == 0:
                break
        
        if N >= tmp:
            N = N//tmp
            ans += 1


print(ans)

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
a = prime_factorize(n)
from collections import Counter
c = Counter(a)
x = set()
ans = 0
import itertools
r = list(itertools.accumulate(list(range(1,10**5))))
from bisect import bisect
for i in c:
    if c[i]==1:
        ans += 1
    else:
        ind = bisect(r,c[i])
        ans += ind


print(ans)

Solution (Python):
from bisect import bisect_right
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
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 LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def pf(x):
    ee=[]
    pp=[]
    if x&1==0:
        k=(x&-x).bit_length()-1
        pp.append(2)
        ee.append(k)
        x>>=k
    d=3
    while d**2<=x:
        while x%d==0:
            x//=d
            if pp and pp[-1]==d:ee[-1]+=1
            else:
                pp.append(d)
                ee.append(1)
        d+=2

    if x>1:
        if pp and pp[-1] == x: ee[-1] += 1
        else:ee.append(1)

    return ee

def main():
    n=II()
    ss=[1]
    for a in range(2,45):ss.append(ss[-1]+a)
    
    ee=pf(n)
    
    ans=0
    for e in ee:
        i=bisect_right(ss,e)
        ans+=i
    print(ans)

main()

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

N = int(input())
N0 = N
primes = []
exp = []
num = 2
while N>1 and num<int(N0**0.5)+1:
    if N%num==0:
        primes.append(num)
        temp = 0
        while N%num==0:
            N //= num
            temp += 1
        exp.append(temp)
    num += 1

if N>1:
    primes.append(N)
    exp.append(1)

        
ans = 0
import math
def solve(e):
    ret = (-1 + math.sqrt(1+8*e))
    ret //= 2
    return int(ret)
for e in exp:
    ans += solve(e)
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
def main():
  N = int(input())
  dic = collections.Counter(prime_factorize(N))
  ans = 0
  for pri, num in dic.items():
    total = 0
    e = 1
    while True:
      total = total + e
      if total > num:
        ans += e-1
        break
      e+=1
  print(ans)
if __name__ == "__main__":
  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, 1])

    return arr
N=int(input())
if N==1:
    print(0)
else:
    ans=0
    for i in range(len(fac(N))):
        a=fac(N)[i][1]
        b=int((2*a+1/4)**0.5-1/2)
        ans+=b
    print(ans)

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

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

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

    return arr

n = int(input())
a = factorization(n)


i = 0
count = 1
allcount = 0

while n > 1:
    if a[i][1] >= count:
        n /= a[i][0]
        a[i][1] -= count
        count += 1
        allcount += 1
    else:
        i += 1
        count = 1
    if i >= len(a):
        break

print(allcount)

Solution (Python):

from math import ceil
def prime_factorization(N):
    
    pf = {}
    for i in range(2, int(N**0.5) + 1):
        while N % i == 0:
            if i not in pf.keys():
                pf[i] = 1
            else:
                pf[i] += 1
            N //= i
    if N > 1:
        pf[N] = 1
    return pf
N = int(input())

pf = prime_factorization(N)

ans = 0
for k in pf.keys():
    idx = 1
    v = 0
    while pf[k] >= v + idx:
        ans += 1
        v += idx
        idx += 1
print(ans)

Solution (Python):
import collections

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

if n == 1:print(0)
else:
    c = collections.Counter(prime_factorize(n))
    kouho = []
    soinnsuu = list(c.keys())
    sisuu = list(c.values())
    '''for i in range(len(soinnsuu)):
        for j in range(1,sisuu[i] + 1):
            kouho.append(soinnsuu[i]**j)
    kouho = list(set(kouho))
    kouho.sort()
    ans = 0
    while n != 1:
        for i in range(len(kouho)):
            if n%kouho[i] == 0 and kouho[i] != -1:
                n //= kouho[i]
                kouho[i] = -1
                ans += 1
                break
    '''
    ans = 0
    for i in sisuu:
        for j in range(1,100):
            if i >= j:
                ans += 1
                i -= j
            else:break
    print(ans)

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

if(N == 1):
  print(0)
  sys.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

hoges = factorization(N)



ans = 0

for hoge in hoges:
    n = hoge[1]

    i = 0
    tmp = 0
    while True:
        i += 1
        tmp += i

        if(tmp > n):
            break
    
        ans += 1

print(ans)

Solution (Python):
from collections import Counter

N = int(input())

if N == 1:
    print(0)
else:
    factors = []

    tmp = N
    for i in range(2, int((N+1)**(1/2))+1):
        while tmp % i == 0:
            factors.append(i)
            tmp //= i
    if tmp != 1:
        factors.append(tmp)
    

    counter = Counter(factors)
    

    remains = []
    ans = 0
    for i, item in enumerate(counter.items()):
        
        key = item[0]
        val = item[1]
        for j in range(1, val+1):
            if val-j >= 0:
                val -= j
                ans += 1
            else:
                break
            
        if val > 0:
            remains.append([key, val])

    

    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
f_arr = factorization(n)
for item in f_arr:
    if item[0] == 1: break

    i = 1
    d = item[1]
    while d > 0:
        d -= i
        if d >= 0:
            ans += 1
        i += 1

print(ans)

Solution (Python):

import collections

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


n = int(input())
pf_n = prime_factorize(n)
count_pf_n = collections.Counter(pf_n)
result = 0

for ci in count_pf_n.items():

    num_ci = ci[1]
    for j in range(1, 9):
        if num_ci < j:

            break
        num_ci -= j
        result += 1

print(result)

Solution (Python):
INT_MAX=10**11+7
MOD=10**9+7
def INPUT():return list(float(i) for i in input().split())
def LIST_1D_ARRAY(n):return [0 for _ in range(n)]
def LIST_2D_ARRAY(m,n):return [[0 for _ in range(n)]for _ in range(m)]
import math

n=int(input())
def calc(x):
    a=0
    return int((math.sqrt(1+8*x)-1)/2)
def primefactorisation(n):
	P=[]
	while(n%2==0):
		P.append(2)
		n//=2
	i=3
	while(i<=int(math.sqrt(n))):
		while(n%i==0):
			P.append(i)
			n//=i
		i+=2
	if(n>2):
		P.append(n)
	return P
A=primefactorisation(n)
i=0
Ans=[]
while(i<len(A)):
    p=A[i]
    count=1
    i+=1
    while(i<len(A) and p==A[i]):
        count+=1
        i+=1
    Ans.append(count)
real=0
for ele in Ans:
    real+=calc(ele)
print(real)

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
if n==1:
    print(0)
    exit()
for i in range(len(p)):
    k=1
    while p[i][1]>0:
        p[i][1]-=k
        if p[i][1]>=0:
            ans+=1
            k+=1
        else:
            break
print(ans)

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

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

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

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

N = factorization(N)
ans = 0
for p, a in N:
    if p == 1:
        break
    for i in range(1, a+1):
        if i*(i+1) >= 2*a:
            if i*(i+1) == 2*a:
                ans += i
            else:
                ans += (i - 1)
            break

print(ans)

Solution (Python):
N = int(input())
pair = dict()
ans = 0
for a in range(2, int(N**(1/2))):
    if N % a != 0:
        continue
    ex = 0
    while N % a == 0:
        ex += 1
        N = N//a
    pair[a] = ex
if N != 1:
    pair[N] = 1
for k in pair.values():
    i = 1
    while k >= i:
        ans += 1
        k -= i
        i += 1
print(ans)

Solution (Python):
import math
import bisect
n = int(input())
saidai = math.ceil(n**0.5)

ruisekiwa = [1]
for i in range(2,100):
    ruisekiwa.append(ruisekiwa[-1]+i)


so_factors = [0 for _ in range(saidai)]

for i in range(2,saidai+1):
    while n%i == 0:
        so_factors[i]+=1
        n = n//i

if n != 1:
    count = 1
else:
    count =0
    
for i in range(len(so_factors)):
    if so_factors[i] > 0:
        count+=bisect.bisect_right(ruisekiwa, so_factors[i])

print(count)

Solution (Python):
from collections import Counter
import math

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 = prime_factorize(n)
count = Counter(a)

ans = 0
for cnt in count.values():
    fib = 0
    for i in range(1, 41):
        fib += i
        if cnt < fib:
            ans += i - 1
            break
print(ans)

Solution (Python):
import bisect

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

kosu=[i*(i+1)//2 for i in range(60)]

n=int(input())
pnum=factorization(n) 
ans=0
for i in range(len(pnum)):
  kata=pnum[i][1]
  tmp=bisect.bisect_left(kosu,kata)-1
  if kata in kosu:
    tmp+=1
  ans+=tmp
  
if n==1:
  ans=0
print(ans)

Solution (Python):
def abc169_d():

    def prime_factorize(n: int) -> list:
        ''' nの素因数分解 '''
        arr = []
        while n % 2 == 0:
            arr.append(2)
            n = n // 2
        f = 3
        while f * f <= n:
            if n % f == 0:
                arr.append(f)
                n = n // f
            else:
                f += 2
        if n != 1:
            arr.append(n)
        return arr

    N = int(input())
    primes = prime_factorize(N)
    ans = 0

    from collections import Counter
    for _, v in Counter(primes).items():
        u = 1
        while True:
            tmp = (u+2) * (u+1) // 2
            if tmp <= v: u += 1
            else: break
        ans += u
    print(ans)

abc169_d()

Solution (Python):
N = int(input())
from collections import Counter
from bisect import bisect
def prime_factorization(n):
    factor = []
    f = 2
    while f ** 2 <= n:
        if n % f == 0:
            factor.append(f)
            n //= f
        else:
            f += 1
    if n > 1:
        factor.append(n)
    return factor

p = prime_factorization(N)
c = Counter(p)

ans = 0
L = [0]
i = 1
while L[-1] < 10**12:
    L.append(i + L[-1])
    i += 1

for a in c.keys():
    b = c[a]
    i = bisect(L, b)
    ans += i-1
print(ans)

Solution (Python):

N = int(input())
def divisor(n):
    fac = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            fac.append(i)
            if i * i != n:
                fac.append(n // i)
    return sorted(fac)
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 = divisor(N)
count = 0
for i in L[1::]:
    if len(factorization(i))==1:
        if N % i == 0:
            N = N/i
            count+=1
print(count)

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

def is_prime(x):
    if x == 2: return True
    if x == 1 or not x % 2: return False
    for i in range(3, int(x**0.5)+1, 2):
        if not x % i: return False
    else: return True
if is_prime(n): print(1); exit()

def get_primes(lim):
    table = [True] * (lim+1)
    table[0:2] = False, False
    for i in range(2, int(lim**0.5)+1):
        if not table[i]: continue
        for j in range(i*2, lim+1, i):
            table[j] = False
    return [i for i in range(lim+1) if table[i]]

def factorize(x, primes):
    res = []
    for p in primes:
        if p ** 2 > x: break
        cnt = 0
        while not x % p:
            x //= p
            cnt += 1
        if cnt: res.append(cnt)
    if x > 1: res.append(1)
    return res

p = get_primes(10**6*2)
f = factorize(n, p)
ans = 0
for x in f:
    for i in range(1, 100):
        if i <= x:
            x -= i
            ans += 1
        else: break

print(ans)

Solution (Python):
N = int(input())
import collections
import math
cnt = 0
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))
v = c.values()
for i in v:
	cnt += math.floor((math.sqrt(8*i+1)-1)/2)
print(cnt)

Solution (Python):
from math import sqrt, floor
N = int(input())

def factorize(n):
    a = []
    count = 0
    temp = n
    if temp % 2 == 0:
        while temp % 2 == 0:
            count += 1
            temp //= 2
        a.append(count)
    for i in range(3,floor(sqrt(n)) + 1,2):
        if temp % i == 0:
            count = 0
            while temp % i == 0:
                count += 1
                temp //= i
            a.append(count)
    if temp != 1: a.append(1)
    
    return a

ans = 0
for i in factorize(N):
    ans += int((-1 + sqrt(1 + 8 * i)) / 2)
print(ans)

Solution (Python):
import collections
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
c =  collections.Counter(prime_factorize(n))
a = c.values()

count =0
for i in a:
    k=1
    for j in range(n):
        if (i==1):
            count+=1
            break
        i-=k
        k +=1
        
        count +=1
        if (i<=k-1):
            break
    
print(count)

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, 1])

  return arr


N=int(input())
ans=0
A=fac(N)
for i in range(len(A)):
  p=2*A[i][1]
  q=p**0.5
  if A[i][0]==1:
    ans+=0
  elif type(q)=="int":
    ans+=q-1
  else:
    q=q//1
    if q*(q+1)<=p:
      ans+=q
    else:
      ans+=q-1
print(int(ans))

Solution (Python):
n = int(input())
dic = {}
def f(num):
    while(num%2==0):
        num //= 2
        if(dic.get(2) is None):
            dic[2] = 1
        else:
            dic[2] += 1
    s = 3
    while((s*s) <= num):
        if((num % s)==0):
            if(dic.get(s) is None):
                dic[s] = 1
            else:
                dic[s] += 1
            num //= s
        else:
            s += 2

    
    if num != 1:
        if(dic.get(num) is None):
            dic[num] = 1
        else:
            dic[num] += 1


f(n)

l = []
for x,y in dic.items():
    cnt = 1
    if(y==1):
        l.append(x)
        continue
    while(y >= cnt):
        l.append((x**cnt))
        y -= cnt
        cnt += 1

print(len(l))

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

n = int(input())
fact_n = factorization(n)
cnt = 0
for _, e in fact_n:
    for i in range(1, 10**3):
        if i*(i + 1) // 2 <= e < (i + 1)*(i + 2) // 2:
            cnt += i
            break
print(cnt)

Solution (Python):
import numpy as np
import math
import scipy as sp
import queue
import collections

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

def main(kwargs):
    n = kwargs["n"]
    arr = factorization(n)

    res = 0

    for i in arr:
        res += sankaku(i[1])

    if n == 1:
        res = 0

    return res

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 sankaku(n):
    res = 1

    while True:
        if res * (res + 1) // 2 <= n < (res + 1) * (res + 2) // 2:
            break

        res += 1

    return res

if __name__ == "__main__":
    kwargs = {}

    cin = input().split()
    kwargs["n"] = [int(i) for i in cin][0]

    cout = main(kwargs)
    print(cout)