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 collections

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


n = int(input())

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

if len(c) == 0:
    print(0)
else:
    ans = 0
    for ci in c.values():
        num = 1
        cnt = 1
        while ci >= num:
            ans += 1
            cnt += 1
            num += cnt
    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())
d = factorization(n)
ans = 0


for i, j in d:
    for k in range(1, 100000):
        if i == 1:
            break
        if j >= k:
            ans += 1
            j -= k
        else:
            break

print(ans)

Solution (Python):

import sys


def solve(N: int):
    L = factorization(N)
    sm = 0
    for l in L:
        if l[0] == 1:
            continue
        n = l[1]
        ct = 1
        while (ct + 1) * ct / 2 <= n:
            ct += 1
        sm += ct - 1

    print(sm)
    return


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():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)

if __name__ == '__main__':
    main()

Solution (Python):
ans = 0
N = int(input())
L = [0] * 10**6
ans = 0
for i in range(2,10**6):
    while N%i == 0:
        N = N//i
        L[i] += 1
if N != 1:
    L[10**6 - 1] = 1
L.sort(reverse=True)
for i in range (10**6):
    if L[i] == 0:
        break
    k = 1
    while L[i] > 0:
        L[i] -= k
        if L[i] >= 0:
            k += 1
            ans += 1
print(ans)

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

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

N = int(input())
d = prime_factor(N)

x = [0] * 10 ** 5
x[0] = -1
for i in range(1, 10 ** 5):
    x[i] = x[i - 1] + i

ans = 0
for v in d.values():
    ans += bisect_left(x, v) - 1
print(ans)

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

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

    return arr

huga=[1]
for i in range(100):
  huga.append(huga[-1]+i+2)
n=int(input())
hoge=factorization(n)
ans=0
for i in range(len(hoge)):
  for j in range(len(huga)):
    if(hoge[i][1]>=huga[j]):
      ans+=1
      
if(n==1):
  print(0)
else:
  print(ans)

Solution (Python):
from collections import Counter


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


n = int(input())
p = prime_factorize(n)
c = Counter(p)

ans = 0
for key, value in c.most_common():
    x = 1
    while x <= c[key]:
        ans += 1
        c[key] -= x
        x += 1

print(ans)

Solution (Python):
import collections
num = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37]
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
ans = 0    
a = prime_factorize(N)
cor = collections.Counter(a)
for v in cor.values():
    tmp = 0
    for nn in num:
        v -= nn
        if v >= 0:
            ans += 1
        else:
            break
print(ans)

Solution (Python):
import math
def f(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()

f = f(N)
ans = 0
for i in range(len(f)):
    ans += (math.sqrt(1+8*f[i][1]) - 1)//2

print(int(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
  

from math import factorial
N=int(input())
if N==1:
  print(0)
else:
  ans=0
  a=factorization(N)
  for b in a:
    p=1
    for i in range(1,10**18):
      if i*(i+1)//2 <=b[1]:
        p=i
      else:
        break
    
    ans +=p
  print(ans)

Solution (Python):
def is_Prime(i):
    if i == 2:
        return True
    if i % 2 == 0 or i == 1:
        return False
    s = int(i ** (1 / 2))
    while True:
        if s == 1:
            return True
        if i % s == 0:
            return False
        s -= 1

def prime_factorize(n):
    ans = []
    for i in range(2, int(n ** (1 / 2)) + 1):
        while True:
            if not n % i == 0:
                break
            ans.append(i)
            n /= i
        if n == 1:
            break
    if n != 1:
        ans.append(int(n))
    return ans

n = int(input())
if n == 1:
    print(0)
    exit()
s = prime_factorize(n)
x = s[0]
t = []
c = 0
for i in s:
    if i == x:
        c += 1
    else:
        t.append(c)
        c = 1
        x = i
t.append(c)
ans = 0
for i in t:
    j = 1
    while True:
        if i - j < 0:
            break
        i -= j
        j += 1
        ans += 1
print(ans)

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

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

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

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

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

    return arr


fact_list = factorization(N)

res = 0
for k, v in fact_list:
    cnt = 1
    while True:
        v -= cnt

        if v == 0:
            res += 1
            break

        if v < 0:
            break

        cnt += 1
        res += 1

print(res)

Solution (Python):

import sys

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

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

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

    return arr


def solve(N: int):
    if N == 1:
        print(0)
        return
    divs = factorization(N)
    ans = 0
    for d in divs:
        k = d[1]
        i = 1
        while k-i >= 0:
            k -= i
            ans+=1
            i+=1
    print(ans)



    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)

if __name__ == '__main__':
    main()

Solution (Python):
import sys
import math
from collections import deque
import heapq
import itertools
from decimal import Decimal
import bisect
MAX_INT = int(10e25)
MIN_INT = -MAX_INT
mod = 1000000000+7
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return 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

N = I()
a = prime_factorize(N)

d = {}
for i in a:
  if i in d:
    d[i] += 1
  else:
    d[i] = 1

ruiseki = [0]
tmp = 0
for i in range(1,200):
  ruiseki.append(ruiseki[-1]+i)

ans = 0
for i in d.values():
  tmp = bisect.bisect_right(ruiseki, i) -1
  ans += tmp
print(ans)

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

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

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

    return arr
def check(n):
    ans=1
    c=0
    for i in range(1,100):
        c+=i
        if(n<c):
            break
        ans=i
    return ans

N=int(input())
if(N>1):
    arr=factorization(N)
    ans=0
    for i in range(len(arr)):
        ans+=check(arr[i][1])
    print(ans)
else:
    print(0)

Solution (Python):
import bisect
def factorization(n):
  m = {}
  _n = n
  for i in range(2, int(n ** (1/2)) + 1):
    if _n % i == 0:
      cnt = 0
      while _n % i == 0:
        _n //= i
        cnt += 1
      m[i] = cnt
  if _n != 1:
    m[_n] = 1
  return m

n = int(input())
m = factorization(n)

ans = 0
for _m in m:
  p = m[_m]
  _tri = 0
  _cnt = 0
  while p >= _tri:
    _cnt += 1
    _tri += _cnt
  ans += _cnt - 1

print(ans)

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

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

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

    return arr

n = int(input())

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

prime = factorization(n)

ans = 0


for i in range(len(prime)):
    s = 0
    for j in range(1, prime[i][1]+1):
        if j*(j+1)/2 <= prime[i][1]:
            s = max(s, j)
    ans += s

print(ans)

Solution (Python):
n=int(input())
if n==1:
    print(0)
    exit()
def sosuu(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True
if sosuu(n):
    print(1)
    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

 


ff=factorization(n) 
d=[]
ans=0
for i,j in ff:
    tmp=0
    while j>0:
        tmp+=1
        j-=tmp

        if j<0:
            break
        ans+=1
print(ans)

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

    n=int(input())
    fact = dict(Counter(prime_factorize(n)))
    cal={}
    ans=0
    for i in fact.values():
        if i not in cal.keys():
            cal[i]=int(((1+8*i)**(1/2)-1)//2)
        ans+=cal[i]
    print(ans)

if __name__ == '__main__':
    resolve()

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
arr=factorization(n)
sumarr=[]
ans=0
for i in range(42):
    sumarr.append(i*(i+1)//2)
for i in arr:
    for j in range(1,41):
        if sumarr[j]<=i[1]<sumarr[j+1]:
            ans+=j
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()

temp = factorization(N)

ans = 0

def counter(num):
    count = 0
    time = 1
    while num > 0:
        num = num - time
        count += 1
        time += 1
        
    if num == 0:
        return count
    if num < 0:
        return count - 1

for i in range(len(temp)):
    ans += counter(temp[i][1])
    
print(ans)

Solution (Python):
import math


inf = 10**12

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

def get_count(k):
    for i in range(inf):
        k -= i
        if k < 0:
            return i-1

def solve(N):
    result = 0
    
    current_count = 0
    while N % 2 == 0:
        current_count += 1
        N //= 2
    result += get_count(current_count)

        
    d = 3
    sqrt = math.sqrt(N)
    while N > 1:
        current_count = 0
        
        
        if d > sqrt:
            
            if N > 1:
                result += 1
                N = 1
        while N % d == 0:
            current_count += 1
            N //= d
            
        if current_count:
            result += get_count(current_count)
            sqrt = math.sqrt(N)
        
        d += 2

    return result


if __name__ == '__main__':
    main()

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))
values = c.values()

ans = 0
for i in values:
    value = i
    l = 1
    while((value - l) >= 0):
        ans += 1
        value -= l
        l += 1

print(ans)

Solution (Python):
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
N = int(input())
tmp = prime_factorize(N)
import collections
C = collections.Counter(tmp)
count = 0
for key in C.keys():
    tmp = C[key]
    i = 0
    while True:
        i += 1
        if tmp >= i:
            tmp -= i
            count += 1
        else:
            break
print(count)

Solution (Python):
def main():
    n = int(input())
    if n == 1:
        print(0)
        return
    def eratos(n):
        flag = [True] * (n + 1)
        for i in range(2, int(n**0.5) + 1):
            if flag[i]:
                for j in range(2*i, n + 1, i):
                    flag[j] = False
        return [i for i, x in enumerate(flag) if x and i >= 2]
    p = eratos(10**6)
    work = []
    for i in p:
        piyo = 0
        while n % i == 0:
            n //= i
            piyo += 1
        if piyo > 0:
            work.append(piyo)
        if n == 1:
            break
    if len(work) == 0:
        print(1)
        return
    else:
        result = 0
        for i in work:
            for j in range(1, 10**6):
                i -= j
                if i <0:
                    break
                result += 1
    if n != 1:
        result += 1
    print(result)
main()

Solution (Python):
from collections import Counter

n = int(input())

divisors = []
e = int(n ** 0.5) + 1
for a in range(2, e):
    while n % a == 0:
        divisors.append(a)
        n //= a
    if n == 1:
        break
if n != 1:
    divisors.append(n)

if len(divisors) == 0:
    print(0)
    exit(0)

ans = 0
ctr = Counter(divisors)
for d, n in ctr.items():
    x = 1
    while n >= x:
        n -= x
        x += 1
        ans += 1
print(ans)

Solution (Python):
import sys
from collections import defaultdict

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

tin=lambda : map(int, input().split())
lin=lambda : list(IN())
mod=1000000007



def main():
	a = int(input())
	
	
	dd = defaultdict(lambda :0)
	for i in range(2, a):
		while a % i == 0:
			dd[i]+=1
			a = a // i
		if i ** 2 > a:
			if a != 1:
				dd[a]+=1
			break
	
	ret = 0
	for key in dd:
		v = dd[key]
		for i in range(1, 100):
			if v < i:
				break
			v -= i
			ret += 1
	print(ret)
		
			
	
	
	
	

isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

Solution (Python):
from sys import stdin
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(stdin.readline().rstrip())
res = 0
if N>=2:
  c = collections.Counter(prime_factorize(N))
  for v in c.values():
    for n in range(1,10):
      if v < n:
        break
      else:
        v -= n
        res += 1
print(res)

Solution (Python):

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

A = 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

prim = factorization(A) 




def count_parts(N):
    
    
    if(N<3):
        return 1
    elif(N<6):
        return 2
    elif(N<10):
        return 3
    elif(N<15):
        return 4
    elif(N<21):
        return 5
    elif(N<28):
        return 6
    elif(N<36):
        return 7
    elif(N<45):
        return 8

ans = 0

for i in range(len(prim)):
    s = prim[i][1]
    ans += count_parts(s)

if(A == 1):
    ans = 0

print(ans)

Solution (Python):
N = int(input())
if N == 1:
  print(0)
  import sys
  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
  
insu = factorization(N)
sum = 0
for i in insu:
  k = i[1]
  tmp = 0
  while True:
    if tmp*(tmp+1)/2 <= k and k < (tmp+2)*(tmp+1)/2:
      break
    tmp += 1
  sum += tmp
    
print(sum)

Solution (Python):
n = int(input())
d = {}
while n % 2 == 0:
    d[2] = 1 if 2 not in d else d[2] + 1
    n //= 2
f = 3
while f * f <= n:
    if n % f == 0:
        d[f] = 1 if f not in d else d[f] + 1
        n //= f
    else:
        f += 2
if n != 1:
    d[n] = 1 if n not in d else d[n] + 1
cnt = 0
for k, v in d.items():
    i = 1
    while i <= v:
        cnt += 1
        v -= i
        i += 1
print(cnt)

Solution (Python):
n=int(input())
_n=n
if n==1:
    print(0)
    exit()
ans=0
for i in range(2,10**6+9):
    c=i
    while(n%c==0):
        n//=c
        ans+=1
        c*=i
    while(n%i==0):
        n//=i
    if n==1:
        break
if i<n:
    ans+=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

c = collections.Counter(prime_factorize(N))
c_values = list(c.values())

list = []
number = 1

cnt = 2
while len(list) < 100:
    for j in range(cnt):
        list.append(number)
    number += 1
    cnt += 1

ans = 0
for i in range(len(c_values)):
    ans += list[c_values[i]-1]

print(ans)

Solution (Python):
from collections import Counter

def main():
    N = int(input())
    pf = prime_factorize(N)

    ans = 0
    for v in pf.values():
        for i in range(1, 100000000):
            if i > v:
                break
            ans += 1
            v -= i

    print(ans)


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

main()

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

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

l = prime_factorize(n)

import collections
count = collections.Counter(l)

total = 0
for dup in count.items():
    total += 1
    appear = dup[1]
    if appear > 1:
        ite = 1
        accu = 1
        while accu < appear:
            ite += 1
            accu += ite
            if accu > appear:
                continue
            total += 1

print(total)

Solution (Python):
import sys

import copy


import bisect
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
inf = 10**20
ri = lambda : int(input())
rs = lambda : input().strip()
rl = lambda : list(map(int, input().split()))
n = ri()
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
acu=[0]*101
acu[0]=0
for i in range(100):
    acu[i+1]=acu[i]+(i+1)

li=factorization(n)
ans=0
for i in li:
    ans+=bisect.bisect_right(acu,i[1])-1
if n==1:
    print(0)
else:
    print(ans)

Solution (Python):

primes = {}
N = int(input())
A = [N]
for val in A:
    p = 2
    while val >= p * p:
        if val % p == 0:
            
            cnt = 0
            while val % p == 0:
                cnt += 1
                val //= p
            if p not in primes:
                primes[p] = cnt
            else:
                primes[p] = max(cnt, primes[p])
        p += 1
    if val != 1:
        if val not in primes:
            primes[val] = 1

ans = 0
for k, v in primes.items():
    now = 1
    while v > 0:
        if v >= now:
            v -= now
            now += 1
            ans += 1
        else:
            v = 0
print(ans)

Solution (Python):


def prime_factorize(N):
    f = []
    i = 2
    while i * i <= N:
        if N % i != 0:
            i += 1
            continue
        
        exp = 0
        
        while N % i == 0:
            exp += 1
            N //= i
        
        f.append([i, exp])
        
        i += 1
    
    if N != 1:
        f.append([N, 1])
    return f


N = int(input())
F = prime_factorize(N)

cnt = 0
for i in range(len(F)):
    a = F[i][1] - 1
    j = 1
    while a >= 0:
        cnt += 1
        j += 1
        a -= j
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

def rui(x):
  if x<3:
    return 1
  elif x<6:
    return 2
  elif x<10:
    return 3
  elif x<15:
    return 4
  elif x<21:
    return 5
  elif x<28:
    return 6
  elif x<36:
    return 7
  else:
    return 8
  
N=int(input())
A=factorization(N) 
ans=0
for i in range(len(A)):
  ans+=rui(A[i][1])
if N==1:
  print(0)
else:
  print(ans)

Solution (Python):

import sys


input = sys.stdin.readline
def IS(cb): return cb(input().strip())
def IL(cb): return [cb(s) for s in input().strip().split()]
def IR(cb, rows): return [IS(cb) for _ in range(rows)]
def ILL(cb, rows): return [IL(cb) for _ in range(rows)]


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 bit_count(i):
    i = i - ((i >> 1) & 0x55555555)
    i = (i & 0x33333333) + ((i >> 2) & 0x33333333)
    i = (i + (i >> 4)) & 0x0f0f0f0f
    i = i + (i >> 8)
    i = i + (i >> 16)
    return i & 0x3f


def solve():
    N = IS(int)
    facts = factorization(N)
    ans = 0
    for p, e in facts:
        if p == 1:
            continue

        ans += int(((1 + 8 * e) ** 0.5 - 1) // 2)

    print(ans)

solve()

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:
    fact = factorization(N) 
    res = 0
    import math 
    for pe in fact:
        add = math.floor((math.sqrt(1+8*pe[1])-1) /2)
        res += add
    print(res)

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
a = Counter(prime_factorize(n))
ans = 0
for i in a.values():
  for j in range(1,1000):
    di = j*(j+1)/2
    if di > i:
      ans += j-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


def main():
    n_ans = [0]*50
    n = int(input())
    if n==1:
        print(0)
        return
        
    facs = factorization(n)

    curr_n = 1
    for i in range(41):
        curr_sum = (curr_n+1)*(curr_n+2)//2
        if i < curr_sum:
            n_ans[i] = curr_n
        else:
            curr_n+=1
            n_ans[i] = curr_n
    
            
    ans = 0
    for fac in facs:
        cnt = fac[1]
        ans += n_ans[cnt]
    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):

import bisect

N = int(input())

arr = [1] * 50
for i in range(2, 50):
    arr[i-1] = arr[i-2]+i

def prime_factorization(n):
    prime_factors = []
    if n < 2:
        return 0
    for i in range(2, int(pow(n, 0.5)+1)):
        if n%i==0:
            ex = 0
            while n%i==0:
                ex += 1
                n //= i
            prime_factors.append((i, ex))
    if n!=1:
        prime_factors.append((n,1))
    return prime_factors

primes = prime_factorization(N)

ans = 0
if N != 1:
    for p, ex in primes:
        ans += bisect.bisect_right(arr, ex)

print(ans)

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

    a = collections.Counter(a)
    return a

def main():
    N = int(input())
    
    fct = prime_factorize(N)
    ans = 0
    for i_fct in fct:
        m = fct[i_fct]
        if m == 1:
            ans += 1
            continue

        sum = 0
        add = 1
        while True:
            sum += add
            if sum > m:
                break
            add += 1
            ans += 1

    print(ans)
    return


if __name__ == "__main__":
    main()
    sys.exit(0)