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 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
List = factorization(N)
ans = 0
for i in range(len(List)):
  X = List[i][1]
  j = 1
  num = 0
  if List[i][0] != 1:
    while True:
      X -= j
      j += 1
      if X >= 0:
        num += 1
      else:
        break
    ans += num
  
print(ans)

Solution (Python):
from math import floor
from math import sqrt
N = int(input())
def f(x):
  return (floor((-1+sqrt(1+8*x))/2.0))
ans = 0
i = 2
while N > 1:
  x = 0
  while N % i == 0:
    N = N // i
    x = x + 1
  if x != 0:
    ans = ans + f(x)
  i = i + 1
  if i > 10 ** 6:
    ans = ans + 1
    break
print(ans)

Solution (Python):
from collections import defaultdict
from collections import OrderedDict
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect,math,heapq
alphabet = "abcdefghijklmnopqrstuvwxyz"


def primeFactors(n):
	count = defaultdict(int)
	while n % 2 == 0: 
		count[2]+=1 
		n = n / 2 
	for i in range(3,int(math.sqrt(n))+1,2): 
		while n % i== 0: 
			count[i]+=1
			n = n / i 
	if n > 2: 
		count[n]+=1
	return count


n = int(input())
c = primeFactors(n)
ans = 0
for k,v in c.items():
	ans += (-1 + (1+8*v)**0.5)//2
print(int(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

def judge(N):
  n = 0
  cnt = 0
  while n < N:
    n += cnt+1
    if n<=N:
      cnt += 1
  return cnt


c = collections.Counter(prime_factorize(N))

ans = 0


keys = c.keys()

for i in range(len(keys)):
  ans += judge(c[list(keys)[i]])

print(ans)

Solution (Python):




import collections

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

N = int(input())

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


c = collections.Counter(prime_factorize(N))

ans = 0

a = list(c.values())

for i in range(len(a)):
    cnt = 1
    while True:
        a[i] -= cnt
        cnt += 1
        if a[i] <0:
            break
        ans += 1

print(ans)

Solution (Python):
from collections import Counter
from itertools import accumulate
from bisect import bisect_right


def factor(n):
    res = []
    for i in range(2, int(n ** .5) + 1):
        while n % i == 0:
            res.append(i)
            n //= i
    if n > 1:
        return res + [n]
    else:
        return res


stairs = list(accumulate(i for i in range(1, 64)))
N = int(input())
factors = factor(N)
ans = 0
for cnt in Counter(factors).values():
    ans += bisect_right(stairs, cnt)
print(ans)

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

def available_n(v):
    value = ((1+8*v)**(1/2) - 1)/2
    return math.floor(value)

n=int(input())
ls = prime_factorize(n)
d={}
for i in ls:
    d.setdefault(i,0)
    d[i]=d[i]+1

count=0
for k,v in d.items():
    count+=available_n(v)

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

count = 0
a = factorization(n)
if n == 1:
  print(0)
  exit()
  
for i in range(len(a)):
  a[i][1] -= 1
  count += 1
  count_n = 2
  while a[i][1] > 0:
    a[i][1] -= count_n
    if a[i][1] >= 0:
      count += 1
    count_n += 1

print(count)

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

def f(n):
  if n==1:
    return []
  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=[]
for p,e in f(n):
  for i in range(1,e+1):
    arr.append(p**i)
arr.sort()

cnt=0
for i in arr:
  if n%i==0:
    cnt+=1
    n//=i

print(cnt)

Solution (Python):
from collections import Counter
def p_factorization(n):
  p=[]
  for i in range(2,int(n**0.5)+1):
    while n%i==0:
      p.append(i)
      n//=i
  if n>1:
    p.append(n)
  return p
n=int(input())
ans=0
for pi in Counter(p_factorization(n)).items():
  x=pi[1]
  for i in range(50):
    if i*(i+1)//2<=x<(i+1)*(i+2)//2:
      ans+=i
      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))
o = 0
for i in c:
    m = 1
    s = 1
    while(c[i] >= s):
        m += 1
        s += m
    o += m - 1
print(o)

Solution (Python):
from functools import reduce
from fractions import gcd
from collections import defaultdict
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")


def prime_decomposition(n):
    i = 2
    ans = 0
    while i * i <= n:
        cnt = 1
        tmp = 0
        while n % i == 0:
            n = n // i
            tmp += 1
            if cnt == tmp:
                ans += 1
                cnt += 1
                tmp = 0
        i += 1
    if n > 1:
        ans += 1
    return ans



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


if __name__ == '__main__':
    main()

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

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

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

    return arr
n=int(input())
s=factorization(n)
ans=0
for i in s:
  k=i[0]
  l=i[1]
  p=1
  while l>=0:
    ans+=1
    l-=p
    p+=1
  ans-=1
if n==1:
  print(0)
else:
  print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(10**7) 
import math
from copy import copy, deepcopy
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right

from collections import deque 


from collections import Counter

from itertools import accumulate

from heapq import heapify,heappop,heappush


from functools import lru_cache


def input(): return sys.stdin.readline()[:-1]
def printl(li): print(*li, sep="\n")
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def main():
    mod = 10**9+7
    

    N = int(input())
    
    
    
    
    cur=0
    isum=[]
    for i in range(1,41):
        cur+=i
        isum.append(cur)
    def prime_factorize(n):
        a = dict()
        while n % 2 == 0:
            a[2]=a.get(2,0)+1
            n //= 2
        f = 3
        while f * f <= n:
            if n % f == 0:
                a[f]=a.get(f,0)+1
                n //= f
            else:
                f += 2
        if n != 1:
            a[n]=a.get(n,0)+1
        return a
    a=prime_factorize(N)
    primes=a.keys()

    
    

    
    
    ans=0

    for p in primes:
        imax=1
        imax=a[p]
        for j,ind in enumerate(isum):
            if imax<ind:
                
                ans+=j
                break

    print(ans)
    
    return 0



if __name__ == "__main__":
    main()

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


ans = 0
n = int(input())
c = collections.Counter(prime_factorize(n))
cnt = list(c.values())

for i in range(len(cnt)):
    mainasu = 1
    while True:
        if cnt[i] == 0 or cnt[i] < mainasu:
            break
        
        cnt[i] -= mainasu
        mainasu += 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

arr = factorization(N)

res = 0
for a,b in arr:
    tmp = 1
    while b >= tmp:
        b = b - tmp
        tmp += 1
        res = res + 1

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

Solution (Python):

import math



if(__name__ == '__main__'):
    
    n = int(input())

    
    div_dict = {}
    nom = n
    while True:
        for denom in range(2,int(math.sqrt(nom)+1)):
            if nom % denom == 0:
                if denom in div_dict:
                    div_dict[denom] += 1
                else:
                    div_dict[denom] = 1
                nom /= denom
                break
        else:
            if nom in div_dict:
                div_dict[nom] += 1
            else:
                div_dict[nom] = 1
            break

    if 1 in div_dict:
        del div_dict[1]

    ans = 0
    for elem in div_dict.values():
        tgt = elem
        sub = 0
        while sub < tgt:
            ans += 1
            sub += 1
            tgt -= sub

    print(ans)

Solution (Python):
def fact(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()
D = fact(n)
ans = 0
for _, d in D:
    k = int(d**.5)
    while (k+1)*(k+2)//2 <= d:
        k += 1
    ans += k
print(ans)

Solution (Python):
n = int(input())
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors

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

seen = set()
flag = True
ans = 0
while flag:
    flag = False
    div = make_divisors(n)
    for i in div:
        if len(prime_factor(i)) == 1 and i not in seen:
            seen.add(i)
            n /= i
            ans += 1
            flag = True
            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))

result = 0
for i in c.values():
    temp = 0
    temp_sum = 0
    while True:
        temp += 1
        temp_sum += temp
        if temp_sum > i:
            break
    result += (temp-1)
        
print(result)

Solution (Python):
import numpy as np


def count(a):
    i = 0
    while a > 0:
        i += 1
        a -= i
        if a == 0:
            break
        if a < 0:
            i -= 1
            break
    return i


def main(N):
    num = N
    ans = 0
    A = np.zeros((1000000), np.int32)
    i = 2
    last = 0
    if N == 1:
        return 0
    while True:
        if num % i == 0:
            num = num//i
            A[i] += 1
        else:
            i += 1
            if num == 1:
                break
            if i*i > num:
                last = 1
                break
    for j in range(i):
        ans += count(A[j])
    ans += last
    return ans


N = int(input())
print(main(N))

Solution (Python):
import sys
import numpy as np
import bisect
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

a = [i for i in range(1,1000)]
s = np.cumsum(a)
s_list=list(s)
N = int(read())
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

arr = factorization(N)
ans = 0
for p in arr:
  index = bisect.bisect_right(s_list, p[1])
  ans += index
print(ans)

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)
else:
    a = factorization(n)
    cnt = 0
    for i in a:
        
        cnt += math.floor((math.sqrt(1+8*i[1])-1)/2)
    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

A = factorization(N)

if len(A)==0 or N==1:
    print(0)
else:    
    c = 0
    for a in A:
        x = a[1]
        s = 0
        for j in range(1, x+1):
            if s + j <= x:
                c +=1
                s += j
            else:
                break
    print(c)

Solution (Python):
from collections import Counter

N = int(input())
pf={}

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

value_ = Counter(list(pf.values()))
result = 0
for k,v in value_.items():
    if k == 1:
        result += v
    else:
        for i in range(k+1):
            if i * (i+1) / 2 > k:
                result += (i-1) * v
                break
print(result)

Solution (Python):
from collections import defaultdict
def factorize(M):
  res=defaultdict(int)
  for i in range(2,int(M**0.5)+1):
    if M==1:
      break
    while M%i==0:
      M//=i
      res[i]+=1  
  if M!=1:
    res[M]=1
  return res

N=int(input())
fact=factorize(N)


def times(n):
  ret=1
  for i in range(2,10**9):
    if n<i*(i+1)//2:
      return ret
    else:
      ret+=1

answer=0
for v in fact.values():  
  
  answer+=times(v)
  
print(answer)

Solution (Python):
import math
import os
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
n = int(input())
arr = factorization(n)
if n==1:
    print(0)
    exit()

for i in range(len(arr)):
    arfa = arr[i][1]
    ans += math.floor((-1+math.sqrt(1+8*arfa))/2)
print(ans)

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

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

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

    return arr
a = int(input())
if a == 1:
    print(0)
    exit()
a = factorization(a)
ans = 0
for i in range(len(a)):
    check = 3
    j = 1
    while True:
        if a[i][1] < check:
            ans += j
            break
        else:
            j += 1
            check += j + 1
print(ans)

Solution (Python):
import math
def prime_factorization(n):
    
    s = math.floor(math.sqrt(n)) 

    ans = [] 

    
    for i in [2] + list(range(3, s + 1, 2)):
        if n < i:
            break
        if n % i == 0:
            r = 0 
            while n % i == 0:
                r += 1
                n //= i
            ans.append([i, r])

    
    
    if n >= s:  
        ans.append([n, 1])

    return(ans)

N = int(input())
pf = prime_factorization(N)

ans = 0
for p, e in pf:
    if p == 1: break
    for i in range(1, 50):
        if e < i: break
        e -= i
        ans += 1

print(ans)

Solution (Python):
n = int(input())
p = dict()
for i in range(2, 10**6+1):
	if n%i == 0:
		p[i] = 1
		n //= i
		while n%i == 0:
			p[i] += 1
			n //= i
if n != 1:
	p[n] = 1

ans = 0
for v in p.values():
	res = 0
	cnt = 1
	while v >= cnt:
		res += 1
		v -= cnt
		cnt += 1
	ans += res
print(ans)

Solution (Python):
def f(i,n):
  ans =0
  cnt = i
  while n%cnt == 0:
    n//=cnt
    cnt*=i
    ans +=1
  while n%i ==0:
    n//=i
  return n,ans

n = int(input())
i = 2
ans = 0
while i <= int(n**0.5)+1:
  if n%i ==0:
    n,a = f(i,n)
    ans += a
  i += 1
  
if n >1:
  ans += 1
print(ans)

Solution (Python):
def prime_factorize(N): 
    exponent = 0
    while N%2 == 0:
        exponent += 1
        N //= 2
    if exponent: factorization = [[2,exponent]]
    else: factorization = []
    i=1
    while i*i <=N:
        i += 2
        if N%i: continue
        exponent = 0
        while N%i == 0:
            exponent += 1
            N //= i
        factorization.append([i,exponent])
    if N!= 1: factorization.append([N,1])
    assert N != 0, "zero"
    return factorization

N = int(input())

pr = prime_factorize(N)


l = len(pr)
s = sum((i for _,i in pr))
ans = 0

ans = 0
for p,e in pr:
    tmp = 1
    ttmp = e
    res = 0
    for i in range(100000):
        if ttmp - tmp < 0:
            break
        res += 1
        ttmp -= tmp
        tmp += 1
    ans += res

print(ans)

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

import collections

N = int(input())
val = collections.Counter(prime_factorize(N))
val = {key:cnt for key,cnt in val.most_common()} 
if val=={}:
    print(0)
else:
    prev_ans = -1
    cnt = 1
    ans = 0
    while ans!=prev_ans:
        prev_ans = ans
        for key in val:
            if val[key]>=cnt:
                val[key]-=cnt
                ans+=1
        cnt+=1
    print(ans)

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

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

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

    return arr
      
n = int(input())
n_list = factorization(n)
oh = []
for i in range(len(n_list)):
  num = n_list[i][0] 
  kata = n_list[i][1] 
  for i in range(1, kata+1):
    oh.append(num ** i)
oh.sort()
ans = 0
z = []
for i in range(len(oh)):
  if oh[i] == 1:
    break
  else:
    if n % oh[i] == 0 and oh[i] not in z:
      z.append(oh[i])
      n = n / oh[i]
      ans += 1
print(ans)

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

array = factorization(n)
if array[0][0] == 1:
    print(0)
    sys.exit()
e_point = 1
count = 0
for i in range(len(array)):
    e = array[i][1]

    while e > 0:
        count += 1
        e -= e_point
        if e < 0:
            count -= 1
            break
        e_point += 1
    e_point = 1
print(count)

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

    while not (n < i*(i+1) / 2):
        i += 1
    
    return i - 1

N = int(input())

delist = prime_factorize(N)

counter = collections.Counter(delist)

count = 0

for key, value in counter.items():
    count = count + sankaku(value)

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())
F = factorization(N)
f = len(F)
answer = 0
for i in range(f):
    count = 1
    if F[i][0] == 1:
        break
    if F[i][1] == 1:
        answer += 1
    else:
        while True:
            if F[i][1] < count:
                break
            else:
                F[i][1] = F[i][1] - count
                count += 1
                answer += 1

print(answer)

Solution (Python):
N = int(input())
if N == 1:
  print(0)
else:
  d = {}
  n = N
  i = 2
  while i*i <= n:
    if n % i == 0:
      d[i] = 1
      n //= i
      while n % i == 0:
        n //= i
        d[i] += 1
    i += 1
  if n != 1:
    d[n] = 1
  ans = 0
  for i in d.values():
    ok = 1
    ng = 50
    while ng-ok > 1:
      mid = (ok+ng)//2
      if mid*(mid+1)//2 <= i:
        ok = mid
      else:
        ng = mid
    ans += ok
  print(ans)

Solution (Python):
import math
def div(n):
    q=[]
    num=[]
    new=1
    while(new):
        orin=n
        for i in range(2,int(math.sqrt(n))):
            if n%i==0:
                q.append(i)
                num.append(0)
                curp = len(num)-1
                new=1
            while(n%i==0):
                n=n//i
                num[curp]+=1
        if orin==n:
            if n!=1:
                q.append(n)
                num.append(1)
            break
    return q,num

def check(num):
    i=1
    count=0
    while(num>=i):
        num-=i
        count+=1
        i+=1
    return count

n=int(input())
q,num=div(n)
if n==1:
    print(0)
else:
    total=0
    for i in range(len(num)):
        total+=check(num[i])
    print(total)

Solution (Python):

ipnl = lambda n: [int(input()) for _ in range(n)]
inp = lambda :int(input())
ip = lambda :[int(w) for w in input().split()]

from math import sqrt 
def count(n):
    return (-1 + sqrt(1 + 8 * n)) // 2
def pfact(num):
    from math import sqrt
    dt = {}
    while num%2==0:
        dt[2] = dt.get(2,0) + 1
        num //= 2
    for i in range(3,int(sqrt(num))+1,2):
        while num%i==0:
            dt[i] = dt.get(i,0) + 1
            num //= i
    if num>2:
        dt[num] = dt.get(num,0) + 1
    return dt
n = inp()
dt = pfact(n)
ctr = 0
for i in list(dt.values()):
    ctr += int(count(i))
print(ctr)

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


fn = factorization(n)

memo = {}
def f(a):
    fa = a
    if a in memo:
        return memo[a]
    if a == 1:
        memo[1] = 1
        return 1
    else: 
        i = 1
        ret = 0
        while a >= i:
            a-=i
            i+=1
            ret+=1
        memo[fa] = ret
        return ret

ans = 0
for u, v in fn:
    ans+=f(v)
if n == 1:
    print(0)
else:
    print(ans)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()

def prime_decomposition(n):
    i = 2
    table = []
    while i * i <= n:
        while n % i == 0:
            n /= i
            table.append(i)
        i += 1
    if n > 1:
        table.append(n)
    return table
p = prime_decomposition(N)

c = Counter(p)

ans = 0
for p, e in c.items():
    i = 0
    cnt = 1
    while cnt <= e:
        e -= cnt
        cnt += 1
        ans += 1
print(ans)

Solution (Python):
from collections import defaultdict

def main():
    n = int(input())
    d = prime_factorize(n)
    cnt = 0
    for k in d.keys():
        cnt_tmp = 1
        while cnt_tmp <= d[k]:
            d[k] -= cnt_tmp
            cnt_tmp += 1
            cnt += 1
    print(cnt)

    

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

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

cnt = 0

a = (factorization(n))

for i in range(len(a)):
    j = 1
    while a[i][1]>=j:
        a[i][1] = a[i][1]-j
        j = j+1
        cnt += 1

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

Solution (Python):
import sys
import copy
from collections import Counter
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(float, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  
n = ni()

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 count(p):
    cnt = 0
    now = 1
    while p>0:
        if p < now:
            break
        p -= now
        cnt += 1
        now += 1
    return cnt

c = Counter(prime_factorize(n))
res = 0
for v in c.values():
    res += count(v)

print(res)

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)

cnt = 0

for p, e in A:
    if p == 1:
        cnt = 0
        break
    for i in range(1, 10**12):
        e -= i
        if e < 0:
            break
        else:
            cnt += 1

print(cnt)

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

l=prime_factorize(n)
c=0
ls=set(l)

ln=[]
for i in iter(ls):
    s=0
    for j in l:
        if i==j:
            s+=1
    ln.append(s)



for i in range(len(ln)):
    c+=int((math.sqrt(1+8*ln[i])-1)/2)

print(c)