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
from io import StringIO
import unittest
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 resolve():
    
    n = int(input())
    
    

    n_list = Counter(prime_factorize(n))
    cnt = 0

    for key, v in n_list.items():
        tmp = 1
        while 1:
            if n_list[key] - tmp >= 0:
                n_list[key] -= tmp
                cnt += 1
                tmp += 1
            else:
                break

    print(cnt)


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """24"""
        output = """3"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """1"""
        output = """0"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """64"""
        output = """3"""
        self.assertIO(input, output)

    def test_入力例_4(self):
        input = """1000000007"""
        output = """1"""
        self.assertIO(input, output)

    def test_入力例_5(self):
        input = """997764507000"""
        output = """7"""
        self.assertIO(input, output)


if __name__ == "__main__":
    
    resolve()

Solution (Python):
trs = [1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171,
       190, 210, 231, 253, 276, 300, 325, 351, 378, 406, 435,
       465, 496, 528, 561, 595, 630, 666, 703, 741, 780]

n = int(input())

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

D = {}

i = 2
while i * i <= n:
    
    if n % i == 0:
        n = n // i
        if i in D:
            D[i] += 1
        else:
            D[i] = 1
    else:
        i += 1

if n in D:
    D[n] += 1
else:
    D[n] = 1



ans = 0
for one in D:
    for ntr, tr in enumerate(trs):
        if tr > D[one]:
            
            ans += ntr
            break

print(ans)

Solution (Python):


def fact(A): 
    c0 = A
    r = 2
    lis = []
    count = 1
    while A != 1:
        if A%r == 0:
            A = A//r
            lis.append(r)
            r = 2
        else:
            r += 1
        if r > int(pow(c0,0.5))+1:
            lis.append(A)
            break
    return(lis)

n = int(input())

lis = fact(n)
lis = list(set(lis))
z = min(len(lis),10)
for i in range(z):
    for j in range(2,1000):
        if lis[i]**j < n:
            lis.append(lis[i]**j)
        else:
            break
lis = sorted(lis)
c = 0
i = 0
while n != 1:
    if i > len(lis) -1:
        break
    if n%lis[i] == 0:
        n = n/lis[i]
        c += 1
    i += 1
print(c)

Solution (Python):
import sys
import math
import copy
import numpy as np




def MinPrime(N, Prime):
    Max = math.ceil(math.sqrt(N))
    Min = Prime+1
    if(N%2 ==0):
        return 2


    Dev = 2
    if(Min%2==0):
        Min += 1
    for Num in range(Min, Max+1, Dev):
        if(N%Num == 0):
            return Num
    return N

def estimatePow(N, Prime):

    Pow = 0
    N_bef = N
    while(N%Prime==0):
        Pow+= 1
        N //= Prime
    
    return [Pow, N]

def estimateTimes(Pow):
    Times = math.floor(math.sqrt(Pow))
    Sum = (1+Times) * Times /2


    while(True):
        Sum *= (Times+2)/Times
        if(Pow < Sum):
            return Times
        Times += 1
    return Times
def calcOperateionTimes(N):
    Prime = 1
    Times = 0
    
    while(N > 1):
        
        Prime= MinPrime(N, Prime)
        Pow_N = estimatePow(N, Prime)
        N = Pow_N[1]
        Times += estimateTimes(Pow_N[0])
    return Times

if(__name__ == "__main__"):

    N = int( input().strip() )



    Times = calcOperateionTimes(N)
    print(Times)

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:
  factN = factorization(N)
  counter = 0
  for i in range(len(factN)):
    t = factN[i][1]
    e = 0
    while True:
      t -= e
      if t < 0:
        counter += e - 1
        break
      e += 1
  print(counter)

Solution (Python):
def fa(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())
soi=fa(N)
ans=0
for n in range(len(soi)):
    if soi[n][1]<=2:
        ans+=1
    elif soi[n][1]<=5:
        ans+=2
    elif soi[n][1]<=9:
        ans+=3
    elif soi[n][1]<=14:
        ans+=4
    elif soi[n][1]<=20:
        ans+=5
    elif soi[n][1]<=27:
        ans+=6
    elif soi[n][1]<=35:
        ans+=7
    elif soi[n][1]<=44:
        ans+=8
    elif soi[n][1]<=54:
        ans+=9
if N==1:
    ans=0
print(ans)

Solution (Python):
import sys
 
if __name__ == '__main__':
    val = int(input().strip())

    arr = []
    i = 2
    while i < int(val ** 0.5 + 1):
        if val % i == 0:
            arr.append(i)
            val //= i
            continue
        i += 1
    if val != 1:
        arr.append(val)
    
    
    count = 0
    cur_val = 0

    for e in arr:
        if cur_val != e:
            cur_val = e
            times = 1
            n = 1
        if times == n * (n + 1) // 2:
            count += 1
            n += 1
        times += 1
    
    print(count)

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())
primes = factorization(N)
nums = []
for i in primes:
    for j in range(i[1]):
        nums.append(i[0] ** (j + 1))
nums_sorted = sorted(nums)
if 1 in nums_sorted:
    nums_sorted.remove(1)

done = []
count = 0
for i in nums_sorted:
    if N < i:
        break
    if N % i == 0:
        count += 1
        N /= i
print(count)

Solution (Python):
n = int(input())
ans = 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
from collections import Counter
c = Counter(prime_factorize(n))
for i in c.values():
    for j in range(1,50):
        if j*(j+1)/2 <= i < (j+1)*(j+2)/2:
            ans += j
            break
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))
ans = 0


for l in c.items():
    x = l[1]
    y = 1
    z = 0
    for i in range(1,x+1):
        z += 1 
        if z > y+1:
            z = 1
            y += 1
    ans += y

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

prime = collections.Counter(prime_factorize(n))

ans = 0
for cnt in prime.values():
    c = 0
    while cnt - c > 0:
        c += 1
        cnt -= c
    ans += c

print(ans)

Solution (Python):
import math
def primeFactors(n):
    d=dict()
    while n % 2 == 0:
        if 2 in d:
            d[2]+=1
        else:
            d[2]=1
        n = n // 2

    for i in range(3, int(math.sqrt(n)) + 1, 2):

        while n % i == 0:
            if i in d:
                d[i] += 1
            else:
                d[i] = 1
            n = n // i

    if n > 2:
        if n in d:
            d[n]+=1
        else:
            d[n]=1

    return d

def getcount(S):
    return int((math.sqrt(1+8*S)-1)/2)


n=int(input())

d = primeFactors(n)

total=0

for x in d:
    total+=getcount(d[x])

print(total)

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

ans = 0
for i in fact:
    if i[1] > 2:
        tmp = 1
        while True:
            i[1] -= tmp
            tmp += 1
            if i[1] < 0:
                break
            ans += 1
    else:
        ans += 1

if n == 1:
    ans = 0
    
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:
    lst = factorization(N)
    ans = 0
    for f, i in lst:
        cnt = i
        for j in range(1, i+1):
            if cnt - j > j:
                ans += 1
                cnt -= j
            else:
                ans += 1
                break
    print(ans)

Solution (Python):
n=int(input())
if n==1:
  print(0)
  exit()
def pf(n):
    a = []
    N = n
    for i in range(2, int(pow(N,0.5)//1+2)):
        if n%i==0:
            count=0
            while n%i==0:
                count+=1
                n //= i
            a.append([i,count])
    if n!=1:
        a.append([n,1])
    if a==[]:
        a.append([n,1])
    return a
l=pf(n)
ans=0
ll=len(l)
for i in range(ll):
  x,y=l[i][0],l[i][1]
  ans+=int((-1+pow(1+8*y,0.5))/2)
print(ans)

Solution (Python):
from collections import Counter


def pf(x):
  if x == 1:
    return []
  r = []
  while not x & 1:
    r += [2]
    x >>= 1
  i = 3
  m = int(x ** 0.5)
  while i < m + 1:
    while not x % i:
      r += [i]
      x //= i
    i += 2
  if x != 1:
    r += [x]
  return r


def main():
  n = int(input())
  
  pp = pf(n)
 
  cc = Counter(pp)
  
  res = 0
  
  for c, v in cc.items():
    i = 1
    while True:
      if i > v:
        break
      v -= i
      res += 1
      i += 1
      
  print(res)


if __name__ == "__main__":
  main()

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)
    exit()
else:
    x =  factorization(N)
    


res = 0

for i,j in x:
    cnt = 1
    while  1:
        j -=cnt
        if j < 0: cnt-=1
        if j < 1:
            break
        cnt+=1
    res+=cnt
    cnt = 1

print(res)

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

C = {}
for i in range(2, max(10, int(N**(0.5))+1)):
    while(N % i == 0):
        N = N//i
        if i not in C:
            C[i] = 1
        else:
            C[i] += 1

if len(C) == 0:
    print(1)
    sys.exit()

ans = 0
for i in C.values():
    s = 1
    while(True):
        i -= s
        if i < 0:
            break
        ans += 1
        s += 1
if N == 1:
    print(ans)
else:
    print(ans+1)

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

l = prime_factorize(S)
x = collections.Counter(l)
X = list(x.values())

y = len(X)
ans = 0
for i in range(y):
    if 1 <=X[i] <= 2:
        ans +=1
    elif 3 <= X[i] <=5 :
        ans += 2
    elif 6<= X[i] <=9:
        ans +=3
    elif 10<= X[i] <=14:
        ans +=4
    elif 15<= X[i] <= 20:
        ans +=5
    elif 21 <= X[i] <= 27:
        ans +=6
    elif 28 <= X[i] <=35:
        ans +=7
    elif 36 <= X[i] <= 44:
        ans +=8
print(ans)

Solution (Python):
import collections
import math

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 i in c.keys():
    count=0
    z=c[i]
    for i in range(55):
        z-=i
        if z>=0:
            count=i
        else:
            break
    ans+=count
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

import math
def D():
    n = int(input())
    if n==1:
        print(0)
        return
    f = factorization(n)
    res = 0
    for i,j in f:
        res += math.floor(math.sqrt(2*j + 1/4) - 1/2)
    print(res)
D()

Solution (Python):
import collections
def calc_prime(N):
  dic={}
  i=2
  while N != 1:
    d,m=divmod(N,i)
    if m==0:
      N=d
      if i not in dic:dic[i]=1
      else:dic[i]+=1
    else:
      i+=1
  return dic
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 k,v in dic.items():
    i=0
    while v > i:
      i+=1
      v-=i
    ans+=i
  print(ans)
if __name__ == '__main__':
  main()

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 solv_quadratic_equation(a, b, c):
    """ 2次方程式を解く  """
    D = (b**2 - 4*a*c) ** (1/2)
    x_1 = (-b + D) / (2 * a)
    x_2 = (-b - D) / (2 * a)
    if x_2 > 0:
        return x_2
    else:
        return x_1

n = int(input())
A = Counter(prime_factorize(n))

ans = 0
for (i, j) in A.items():
    c = int(solv_quadratic_equation(1, 1, -2 * j))
    ans += 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

n = int(input())
if n == 1:
    print(0)
else:
    l = factorization(n)
    dic = []
    for i in range(len(l)):
        tmp = l[i][0]
        dic.append(tmp)
        while n >= tmp:
            tmp *= l[i][0]
            if n < tmp:
                break
            dic.append(tmp)
    dic.sort()
    cnt = 0
    while n != 1:
        flag = True
        for i in range(len(dic)):
            if n%dic[i] == 0:
                n //= dic[i]
                cnt += 1
                dic.pop(i)
                flag = False
                break
        if flag:
            break
    print(cnt)

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:
    ans = 0
    for p, e in factorization(n):
        i = 1
        while e >= i:
            e -= i
            i += 1
            ans += 1

    print(ans)

Solution (Python):


import collections
import math


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



result = 0
c = collections.Counter(prime_factorize(N))
for p, e in c.items():
    result += int((-1 + math.sqrt(1 + 8*e)) / 2)



print(result)

Solution (Python):
import numpy as np

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

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


N = int(input())
soinsu = np.array(factorization(N))
tate = soinsu.shape[0]
kaisawa = []
wa = 0
for i in range(100):
    kaisawa.append(((i+2)*(i+1)//2))

for i in range(tate):
    for j in range(100):
        if soinsu[i, 1] < kaisawa[j]:
            wa += j
            break

if N == 1:
    wa = 0

print(wa)

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

arr = factorize(N)

count = 0
for p,e in arr:
  i = 1
  while True:
    if e < i:
      break
    e -= i
    i += 1
    count += 1      

print(count)

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


def divisor(x):
    ans=set([])
    i=1
    while(i*i<=x):
        if(x%i==0):
            ans.add(i)
            ans.add(x//i)
        i+=1
    ans=sorted(list(ans))
    return ans

div_n=divisor(n)[1:]


prime_n=[]
isprime=[True for _ in range(len(div_n))]
for i in range(len(div_n)):
    if(isprime[i]):
        for j in range(i+1,len(div_n)):
            if(div_n[j]%div_n[i]==0):
                isprime[j]=False
        prime_n.append(div_n[i])
    else:
        pass


soinsu={}
for di in prime_n:
    ans_di=0
    ni=n
    while(ni%di==0):
        ni//=di
        ans_di+=1
    soinsu[di]=ans_di


ans=0
for k,v in soinsu.items():
    vi=v
    i=1
    while(vi>=i):
        vi-=i
        i+=1
        ans+=1
print(ans)

Solution (Python):

import math
n = int(input())
t = n
p = {}

for i in range(2, int(math.sqrt(t)+1)):
    while n%i==0 and n > 1:
        n = n//i 
        if p.get(i, -1) == -1:
            p[i] = 1 
        else:
            p[i] += 1 
    
if n > 1:
    p[n] = 1 

ans = 0

for val in p.values():
    i = 1 
    while val >= i: 
        val -= i 
        i += 1 
        ans += 1 

print(ans)

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

import collections

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

c = collections.Counter(prime_factorize(N))

A = c.keys()
count = c.values()

ans = 0

for i in count:
  k = 0
  for j in range(1,i+1):
    k += j
    if k <= i:
      ans += 1
      
print(ans)

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

def function(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
b = function(n)
c = collections.Counter(function(n))
ans = 0
for number in (c.values()):
  iter = 1
  flag = True
  while flag:
    number -= iter
    ans += 1
    iter += 1
    if number < iter:
      flag = False
print(ans)

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

pf={}

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

sum = 0
for key in pf:
    if pf[key] > 1:
        i = 1
        d = pf[key]
        while True:
            if d - i >= 0:
                d-=i
                sum+=1
                i+=1
            else:
                break
    else:
        sum+=1


print(sum)

Solution (Python):
import math

n = int(input())

if n==1:
  print(0)
else:
  fctr = []
  for a in range(2,math.isqrt(n)+1):
    atta = 0
    if n%a==0:
      while n%a==0:
        atta += 1
        n //= a
      fctr.append((a,atta))
  if n!=1:
    fctr.append((n,1))


  kaisu = 0
  for pair in fctr:
    if pair[1]<3:
      kaisu += 1
    elif pair[1]<6:
      kaisu += 2
    elif pair[1]<10:
      kaisu += 3
    elif pair[1]<15:
      kaisu += 4
    elif pair[1]<21:
      kaisu += 5
    elif pair[1]<28:
      kaisu += 6
    elif pair[1]<36:
      kaisu += 7
    elif pair[1]<45:
      kaisu += 8
    elif pair[1]<55:
      kaisu += 9

  print(kaisu)

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())
l  = list(collections.Counter(prime_factorize(n)).values())
count = 0
for i in l:
    x = i
    check = 1
    while True:
        if x >= check:
            x -= check
            count += 1
            check += 1
        else:
            break
print(count)

Solution (Python):
from collections import Counter

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


c1 = Counter(prime_factorize(N))
count = 0

for key in c1.keys():
    v = c1[key]
    for i in range(1, v + 1):
        if c1[key] < i:
            break
        c1[key] -= i
        count += 1

print(count)

Solution (Python):
from collections import defaultdict

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())
    pfactor = prime_factorize(n)
    d = defaultdict(int)
    for p in pfactor:
        d[p] += 1
    hoge = []
    a = 0
    for i in range(100):
        tmp = 1 + i
        a += tmp
        hoge.append(a)
    cnt = 1
    score = []
    for i, j in zip(hoge[:-1], hoge[1:]):
        for _ in range(j - i):
            score.append(cnt)
        cnt += 1
    res = 0
    for v in d.values():
        res += score[v-1]
    print(res)

     

if __name__ == '__main__':
    main()

Solution (Python):
import math

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

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

result = 0
factList = factorization(n)
for fact in factList:
  count = math.floor(math.sqrt(2 * fact[1] + 0.25) - 0.5)
  result += count
print(result)

Solution (Python):
from collections import defaultdict


def prime_factorization(n):
    divs = defaultdict(int)

    while n % 2 == 0:
        divs[2] += 1
        n //= 2

    i = 3
    while i <= int(n ** .5) + 1:
        while n % i == 0:
            divs[i] += 1
            n //= i
        i += 2
    if n != 1:
        divs[n] += 1

    return divs

import bisect
N = int(input())
divs = prime_factorization(N)

MAX_VAL = 13
table = [n * (n + 1) // 2 for n in range(1, MAX_VAL)]
ans = 0
for key, value in divs.items():
    idx = bisect.bisect_left(table, value)
    ans += idx + 1 if table[idx] == value else idx

print(ans)

Solution (Python):
import sys
def factorization(n):
    arr = []
    temp = n
    ele = 1
    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 __name__ == "__main__":
    n = int(input())
    if n == 1:
        print(0)
        sys.exit(0)
    ar = factorization(n)
    ans = 0
    for ele in ar:
        cnt = ele[1]
        num = 1
        while True:
            if cnt - num < 0:
                break
            else:
                cnt -= num
                num += 1
        ans += num - 1
    print(ans)

Solution (Python):
import math

n=int(input())

kotae=[]
temp=n

for i in range(2,int(math.sqrt(n)//1)+1):
  if temp%i==0:
    count=0
    while temp%i==0:
      temp=temp/i
      count+=1
    kotae.append([i,count])
if temp!=1:
  kotae.append([n,1])

answer=0
for i in range(len(kotae)):
  kaisuu=0
  taisyo=kotae[i][1]
  while taisyo>=0:
    kaisuu+=1
    taisyo-=kaisuu
  answer+=kaisuu-1

print(answer)

Solution (Python):

import math
N = int(input())
n = N
ans = 0


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


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


d = set()

for x, a in factorization(N):
    tmp = 1
    if x == 1:
        continue
    for i in range(a):
        tmp *= x
        d.add(tmp)

d = list(d)
d.sort()
for i in d:
    if N % i == 0:
        N = N // i
        ans += 1

print(ans)

Solution (Python):
n=int(input())
k=n
dic={}
import math
for i in range(2,math.floor(math.sqrt(n))):
  for j in range(10**10):
    if n%i==0:
      if i in dic:
        dic[i]+=1
      else:
        dic[i]=1
      n=n//i
    else:
      break

count=0
if k!=1:
  if not dic or n!=1:
    count+=1

while dic:
  keep=1
  x=dic.popitem()
  num=x[1]
  for i in range(1000):
    if num>=keep:
      num-=keep
      count+=1
      keep+=1
    else:
      break
print(count)

Solution (Python):
import sys, collections
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**20
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()

def resolve():
    N = I()

    def sieve(n):
        is_prime = [True for _ in range(n+1)]
        is_prime[0] = False
        is_prime[1] = False
        for i in range(2, int(n**0.5)+1):
            if is_prime[i]:
                for j in range(i*2, n+1, i):
                    is_prime[j] = False
        return [i for i in range(n+1) if is_prime[i]]

    primes = sieve(int(N**0.5))

    ans = []
    temp = N
    for i in primes:
        j = i
        while j<int(N**0.5)+1:
            if temp%j == 0:
                ans.append(j)
                temp //= j
            j *= i
    if temp > int(N**0.5):
        ans.append(temp)

    
    print(len(ans))

if __name__ == '__main__':
    resolve()

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

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

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

    return arr
n = int(input())
if n == 1:
  print(0)
else:
  arr = factorization(n)
  arr_len = len(arr)
  count = 0
  for i in range(arr_len):
    arr_i = arr[i]
    if arr_i < 3:
      count += 1
    elif arr_i < 6:
      count += 2
    elif arr_i < 10:
      count += 3
    elif arr_i < 15:
      count += 4
    elif arr_i < 21:
      count += 5
    elif arr_i < 28:
      count += 6
    elif arr_i < 36:
      count += 7
    else:
      count += 8
  print(count)