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):
from sys import stdin, setrecursionlimit
from bisect import bisect_right


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[i] = cnt

    if temp != 1:
        arr[temp] = 1

    if arr == []:
        arr[n] = 1

    return arr


def main():
    input = stdin.buffer.readline
    n = int(input())

    a1 = [0]
    for i in range(10 ** 4):
        a1.append(a1[i] + i + 1)

    ans = 0
    a2 = factorization(n)
    for k in a2:
        ans += bisect_right(a1, a2[k]) - 1

    print(ans)


if __name__ == "__main__":
    setrecursionlimit(10000)
    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())
if n == 1:
    print(0)
    exit()

a = factorization(n)


ans = 0
for i in range(len(a)):
    check = 1
    while a[i][1] >= check:
        a[i][1] = a[i][1] - check
        ans = ans + 1
        check = check + 1

print(ans)

Solution (Python):
import sys
import collections

sys.setrecursionlimit(10**6)
readline = sys.stdin.readline


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())
    pf = prime_factorize(N)
    if len(pf) == 0:
        print(0)
        return
    pfitems = list(zip(*collections.Counter(pf).items()))
    cnt = 0
    for i in pfitems[1]:
        tmp = i
        for j in range(1, i+1):
            tmp -= j
            if tmp < 0:
                break
            cnt += 1

    print(cnt)

if __name__ == "__main__":
    main()

Solution (Python):
from math import sqrt
n = int(input())
ans = 0
for i in range(2, 1 + int(sqrt(n))):
    c = 0
    while n % i == 0:
        n //= i
        c += 1
    ans += int((-1 + sqrt(1 + 8 * c)) / 2)
if n != 1:
    ans += 1
print(ans)

Solution (Python):
from collections import defaultdict
n = int(input())
d = defaultdict(int)
for i in range(2, int(n**0.5)+1):
    while(n%i == 0):
        n//=i
        d[i]+=1
if n > 1:
    d[n]+=1
ans = 0
for i in d.values():
    val = 1
    while i >= val:
        i-=val
        ans+=1
        val+=1
print(ans)

Solution (Python):
def LI():return list(map(int,input().split()))
def yes():return print("Yes")
def no():return print("No")
from collections import deque, defaultdict, Counter















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

n=int(input())
pf=prime_factor(n)
pf=Counter(pf)


def cng(x):
    le=2*x
    ret=-1
    mi=int(le**0.5)
    for i in range(mi-1,mi+10000):
        
        if (i+1)*(i+2)>le>=i*(i+1):
            ret=i
            
            break
        
    return ret

mp=[]   
for i in range(2*10**5):
    mp.append(cng(i))


ans=0
for i in pf.values():
    ans+=mp[i]
    
print(ans)

Solution (Python):
from collections import defaultdict

def fctr1(n): 
    d = defaultdict(int)
    c=0
    r=int(n**0.5)
    for i in range(2,r+2):
        while n%i==0:
            c+=1
            n=n//i
        if c!=0:
            d[i] = c
            c=0
    if n!=1:
        d[n] = 1
    return d

def main():
    N = int(input())
    primes = fctr1(N)
    d = defaultdict(int)
    ans = 0
    for i, j in primes.items():
        cnt = 1
        while True:
            if j - cnt < 0:
                d[i] = j
                break
            ans += 1
            j -= cnt
            cnt += 1

    print(ans)





if __name__ == "__main__":
    main()

Solution (Python):

from sys import stdin
input = stdin.readline
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True 
BIG = 10**18
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

import math


def isprime(x):
    q = int(math.sqrt(x))  
    for i in range(2,q+1):   
        if x%i == 0:
            return False
    return True

def prime_division(x):
    q = int(math.sqrt(x))
    a = []
    for i in range(2,q+1):
        ex = 0
        while x%i == 0:
            ex += 1
            x //= i
        if ex>0:
            a.append([i,ex])
    if x>q:
        a.append([x,1])
    return a

def prime_division2(x):
    q = int(math.sqrt(x))
    h = {}
    for i in range(2,q+1):
        ex = 0
        while x%i == 0:
            ex += 1
            x //= i
        if ex>0:
            h[i] = ex
    if x>q:
        h[x] = 1
    return h

def divisorlist(z): 
    if len(z)==1:
        return [z[0][0]**i for i in range(z[0][1]+1)]
    y = divisorlist(z[1:])
    s = []
    for i in range(z[0][1]+1):
        for j in y:
            s.append((z[0][0]**i)*j)
    return s

n = inn()
sm = 0
pes = prime_division(n)
for p,e in pes:
    for i in range(1,50):
        if e<2*i+1:
            break
        sm += 1
        e -= i
    sm += 1
print(sm)

Solution (Python):


import math

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

factors = factorization(N)

result = 0
for fact in factors:
    result += int((-1+math.sqrt(8*fact[1]+1))/2)

print(result)

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
l=[0]
ii=0
for i in range(1,11):
    ii+=i
    l.append(ii)

n=int(input())
import collections
c=collections.Counter(prime_factorize(n))
count=0
for i in c.values():
    for j in range(10):
        if i>=l[j] and i<l[j+1]:
            count+=j
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

def count_sums(n):
    c = 1    
    while True:
        if n - c < 0:
            break
        n -= c
        c += 1
    return c - 1

N = int(input())
if N == 1:
    print(0)
else:
    
    p_N = factorization(N)
    if p_N == [N, 1]:
        print(1)
    else:
        count = 0
        for arr in p_N:
            count += count_sums(arr[1])
        print(count)

Solution (Python):
import math
input = raw_input

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

def find_max(x):
    n0 = int(math.sqrt(2*x))

    if 2 * x < n0 * (n0+1):
        while True:
            n1 = n0 - 1
            if 2 * x >= n1 * (n1+1):
                return n1
            n0 = n1 
    else:
        while True:
            n1 = n0 + 1
            if 2 * x < n1 * (n1+1):
                return n0
            n0 = n1 

    
    
    

n = int(input())

pairs = fctr1(n)

out = 0
for p, num in pairs:
    x0 = find_max(num)
    out += x0
print(out)

Solution (Python):
import math 
def primeFactors(n):
    pf = []
    while n % 2 == 0: 
        pf.append(2) 
        n = n / 2 
    for i in range(3,int(math.sqrt(n))+1,2): 
        while n % i== 0: 
            pf.append(i) 
            n = n / i 
    if n > 2: 
        pf.append(n) 
    return pf
n = int(input())
pf = primeFactors(n)

dic = {}
for i in pf:
    try:
        dic[i] += 1
    except:
        dic[i] = 1
ans = 0
for i in dic:
    c = dic[i]
    tmp = (((1 + 8 * c) ** (0.5)) - 1) // 2
    ans += tmp
print(int(ans))

Solution (Python):
import math

N = int(input())
ans = 0
Flag = True

def prime_fac(n):
  p_lis = []
  temp = n

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

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

  return p_lis

def f(n):
  cnt = 0
  i = 1
  temp = n - 1
  while temp >= 0:
    cnt += 1
    i += 1
    temp -= i
  return cnt

if N == 1:
  Flag = False
else:
  L = prime_fac(N)
  for P in L:
    ans += f(P[1])

if Flag:
  print(ans)
else:
  print(0)

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 getnum(n):
    ret = 1
    _sum = 1
    while True:
        if _sum > n:
            return ret-1
        ret += 1
        _sum += ret

def main():
    n = int(input())
    aa = factorization(n)
    ret = 0
    for a in aa:
        if a[0] == 1:
            continue
        ret += getnum(a[1])
    print(ret)

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())
ans = 0
if n == 1:
    ans = 0
else:
    bunkai = factorization(n)
    for i in bunkai:
        if i[1] < 3:
            ans += 1
        elif i[1] < 6:
            ans += 2
        elif i[1] < 10:
            ans += 3
        elif i[1] < 15:
            ans += 4
        elif i[1] < 21:
            ans += 5
        elif i[1] < 28:
            ans += 6
        elif i[1] < 36:
            ans += 7
        elif i[1] < 45:
            ans += 8
        else:
            ans += 9

print(ans)

Solution (Python):
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
n = int(input())
l = make_divisors(n)
ans = 0
for i in range(1, len(l)):
    cnt = 0
    while n % l[i] == 0:
        cnt += 1
        n //= l[i]
    i = 1
    while True:
        if cnt - i >= 0:
            ans += 1
            cnt -= i
            i += 1
        else:
            break
print(ans)

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

def trial_division(n):
    prime_factors = list()
    while n % 2 == 0:
        prime_factors.append(2)
        n //= 2
    p = 3
    while p * p <= n:
        if n % p == 0:
            prime_factors.append(p)
            n //= p
        else:
            p += 2
    if n != 1:
        prime_factors.append(n)
    return prime_factors

C = Counter(trial_division(N))
ans = 0
for key,value in C.items():
    check = 0
    for i in range(1,value+1):
        check = (i * (i + 1))//2
        if value >= check:
            ans += 1
        else:
            break
print(ans)

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

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

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

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

    return arr
if N==1:
  print(0)
else: 
	count=0  
	k=[1,3,6,10,15,21,28,36,45,55]
	l=factorization(N)
	
	for i in l:
  		q=bisect.bisect(k,i[1])
  		count+=q
  
	print(count)

Solution (Python):
def make_divisors(n):
    divisors = {}
    tmp = n
    for div in range(2, int(n**0.5)+1):
        if n % div == 0:
            divisors[div] = 0
        while n % div == 0:
            n //= div
            divisors[div] += 1
        div += 1
    if n > 1:
        divisors[n] = 1
    return divisors

def resolve():
    n = int(input())
    div = make_divisors(n)
    ans = 0
    for k,v in div.items():
        cnt = 1
        while v >= cnt:
            ans += 1
            v -= cnt
            cnt += 1
    print(ans)


if __name__ == "__main__":
    resolve()

Solution (Python):
from sys import stdin
from copy import deepcopy
from functools import reduce
from fractions import gcd
import math
import itertools
from collections import Counter
from itertools import chain  
from heapq import heappush, heappop
import bisect

"""
N = int(input())
A, B = map(int,input().split())
A = list(map(int,input().split())) 
A = [int(input()) for _ in range(N)] 
lst = [list(map(int,input().split())) for i in range(M)] 
"""

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

div = factorization(N)


ans = 0
for i in range(len(div)):
  x = div[i][1]
  var = int((-1 + math.sqrt(1 + 8*x)) / 2)
  ans += var
  
  

print(ans)

Solution (Python):
import math
N = int(input())
if N <= 1:
    print(0)
    exit()

L = math.ceil(math.sqrt(N)) + 1
isPrime = [True] * L
isPrime[0] = isPrime[1] = False
primes = []
for n in range(2, L):
    if isPrime[n]:
        primes.append(n)
        isPrime[2*n::n] = [False] * ((L-n-1) // n)

ans = 0
for p in primes:
    d = p
    while N % d == 0:
        ans += 1
        N //= d
        d *= p
    while N % p == 0:
        N //= p

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

def cnt(n,c):
    ans=0
    a=1
    for i in c.keys():
        b=1
        while c[i]-b>=0:
            ans+=1
            c[i]-=b
            b+=1
    return ans

print(cnt(n,c))

Solution (Python):
import sys

readline = sys.stdin.readline
readlines = sys.stdin.readlines
ns = lambda: readline().rstrip() 
ni = lambda: int(readline().rstrip()) 
nm = lambda: map(int, readline().split()) 
nl = lambda: list(map(int, readline().split())) 

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

ans = 0
for pair in factors:
    p = pair[0]
    num = pair[1]
    cnt = 1
    while True:
        num -= cnt
        if num < 0:
            break
        cnt += 1
    ans += (cnt-1)
print(ans)

Solution (Python):
def factor(n):
    table = []
    i = 2
    while i * i <= n:
        if n % i == 0:
            cnt = 0
            while n % i == 0:
                n //= i
                cnt += 1
            table.append((i, cnt))
        i += 1
    if n > 1:
        table.append((n, 1))
    return table

N = int(input())

F = factor(N)

ans = 0
for _, e in F:
    x = 1
    while not (x * (x + 1) <= 2 * e < (x + 1) * (x + 2)):
        x += 1
    ans += x

print(ans)

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

if N == 1:
  print(0)

else:
  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

  f = factorization(N)
  ans = 0

  for i in range(1,100):
    f = list(map(lambda x:x-i,f))
    ans += len([j for j in f if j >= 0])

  print(ans)

Solution (Python):
from math import sqrt
n = int(input())
ans = 0
for i in range(2, 1 + int(sqrt(n))):
    c = 0
    while n % i == 0:
        n //= i
        c += 1
    ans += int((-1 + sqrt(1 + 8 * c)) / 2)
if n != 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

def test(a):
    ret=0
    c=1
    while True:
        if a<ret+c:
            break
        else:
            ret+=c
            c+=1
    return c-1

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

a=factorization(N) 
ans=0
for p,q in a:
    ans+=test(q)
print(ans)

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

def prime_decompose(x):
    decomposed = []
    for i in range(2,int(pow(x,0.5))+1):
        while x % i == 0:
            x //= i
            decomposed.append(i)
    if x > 1:
        decomposed.append(x)
    return decomposed

N = int(input())
d = prime_decompose(N)
cnt = Counter(d)
ref = [0] * 50
for i in range(len(ref)):
    ref[i] = sum(range(1,i+2))

ans = 0
for i in cnt:
    ans += bisect_right(ref, cnt[i])

print(ans)

Solution (Python):
n=int(input())
if n==1:
    print(0)
else:
    def fac(n):
        arr=[]
        temp=n
        for i in range(2,int(-(-n**0.5//1))+1):
            if temp%i==0:
                cnt=0
                while temp%i==0:
                    cnt+=1
                    temp//=i
                arr.append(cnt)
        if temp!=1:
            arr.append(1)
        if arr==[]:
            arr.append(1)
        return arr
    anss=fac(n)
    dic={}
    ans=0
    for i in anss:
        if i in dic:
            ans+=dic[i]
        elif i==1:
            dic[i]=1
            ans+=1
        else:
            j=i
            ansss=0
            cou=1
            while j>=cou:
                ansss+=1
                j-=cou
                cou+=1
            ans+=ansss
            dic[i]=ansss
    print(ans)

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

soi = soinsu(n)
cand=[ s[1] for s in soi]

aida = [(i)*(i+1)//2 for i in range(1,45)]
import bisect

print(sum(bisect.bisect(aida,c) for c in cand) )

Solution (Python):
def fanction(n):
    listIn = []
    tmp = n
    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if tmp % i == 0:
            cnt_in = 0
            while tmp % i ==0:
                cnt_in += 1
                tmp //= i
            listIn.append([i, cnt_in])

    if tmp != 1:
        listIn.append([tmp, 1])

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

    return listIn

N = int(input())

arr = fanction(N)

tmp = 1
count = 0
for a, b in arr:
    if a <= 1:
        continue
    while 'true':
        if b >= tmp:
            b -= tmp
            count += 1
            tmp += 1
        else:
            tmp = 1
            break

print(count)

Solution (Python):
m = int(input())
if m==1:
    print(0)
    exit()
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
key=list(pf.keys())
used=[0]*len(key)

cnt=0
for i in range(len(key)):
    k=key[i]
    tmp=0
    while pf[k]>used[i]+tmp:
        tmp+=1
        used[i]+=tmp
        cnt+=1
        
print(cnt)

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)



l = []

for a, b in arr:
   temp = 1
   for i in range(1,b+1):
       temp *= a
       l.append(temp)

cnt = 0
for i in l:
    if n % i == 0:
        n = int(n/i)
        cnt += 1
    
   
print(cnt)

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

    upper_divisors.reverse()
    return lower_divisors + upper_divisors

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

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

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

    return arr

n = int(input())

ans = []
used_list = []

def solve(n, used_list):
  if n == 1:
    return len(used_list)
  div_list = make_divisors(n)[1:]
  for i in div_list:
    z_kouho = factorization(i)
    if i not in used_list and len(z_kouho) == 1:
      used_list.append(i)
      return solve(int(n/i),used_list)
  
  return len(used_list)
      
print(solve(n, used_list))

Solution (Python):
from math import sqrt
n = int(input())
ans = 0
for i in range(2, 1 + int(sqrt(n))):
    c = 0
    while n % i == 0:
        n //= i
        c += 1
    ans += int((-1 + sqrt(1 + 8 * c)) / 2)
if n != 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

if n == 1:
  print(0)
else:
  arr = factorization(n)
  c = 0
  for e in arr:
    now = 0
    while e[1] > now:
      now += 1
      e[1] -= now
    c += now
  print(c)

Solution (Python):
N=int(input())
if N==1:
  print(0)
  exit(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

X=factorization(N)
ans=0
for p,n in X:
  _n=0
  while n>0:
    _n+=1
    if n-_n<=_n:
      n=0
    else:
      n-=_n
    ans+=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(cnt)

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

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

    return arr

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

    if N == 1:
        print(0)
        return

    e_num = []
    for i in range(0, 40):
        for k in range(0, i+1):
            e_num.append(i)
    

    e_list = factorization(N)

    ans = 0
    for e in e_list:
        ans += e_num[e]
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
import math
import collections

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


N = int(input())

counter = collections.Counter(prime_factorize(N))


ans = 0
for key in counter.keys():
    num = counter[key]
    i = 1
    while num >= i:
        num -= i
        ans += 1
        i += 1

print(ans)

Solution (Python):
import sys
from math import log2,floor,ceil,sqrt






















Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()
 
def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
INF = 10 ** 18
MOD = 10**9+7
N = 10**6 +1







    











def solve(cnt):
    val = (-1+sqrt(1+8*cnt))/2
    return floor(val)



n = int(ri())

ans = 0
if n == 1:
    print(0)
else:
    p = 2
    while p*p <= n:
        cnt = 0
        while(n%p == 0):
            cnt+=1
            n= n//p
        if cnt != 0:
            
            ans+=solve(cnt)
        p+=1
    if n != 1:
        ans +=1

    print(ans)

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

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

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

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

        return arr
    if n==1:
        print(0)
    else:
        a=f(n)
        ans=0
        for i in a:
            k=1
            while i>=k:
                i-=k
                k+=1
            ans+=k-1
        print(ans)
resolve()

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

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

a = factorization(n)
c = 0
for i in a:
	k = 1
	x = i[1]
	while x >= 0:
		x -= k
		if x < 0:
			break
		c += 1
		k += 1
if n == 1:
	print (0)
else:
	print (c)

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

res = collections.Counter(prime_factorize(N))
keys = list(res.keys())

length = len(keys)
ans = 0
for i in range(length):
    temp = 1
    num = res[keys[i]]
    while(num >= temp):
        ans += 1
        num -= temp
        temp += 1
print(ans)

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

n = int(input())
if n == 1:
    print(0)
else:
    count = prime_factorize(n)
    count_dict = defaultdict(int)
    for c in count:
        count_dict[c] += 1
    ans = 0
    for key,value in count_dict.items():
        tmp = value
        m = 1
        while tmp >= m:
            tmp -= m
            m += 1
            ans += 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


def main():
    N = int(input())
    import collections
    p = collections.Counter(prime_factorize(N))
    l = list(p.values())
    ans = 0
    for i in range(len(l)):
        c = l[i]
        if(c == 1 or c == 2):
            ans += 1
            continue
        for j in range(c):
            if ((j * (j + 1)) // 2 == c):
                ans += j
                break
            elif ((j * (j + 1)) // 2 > c):
                ans += j - 1
                break
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
now = 2
counter = 0
k = []
ans = 0
while N != 1:
    if N % now == 0:
        N = N // now
        counter += 1
    else:
        now += 1
        if N < now ** 2:
            k.append(counter)
            counter = 1
            break
        if counter != 0:
            k.append(counter)
            counter = 0
k.append(counter)
for i in range(len(k)):
    counter = 2
    while k[i] > 0:
        k[i] -= counter
        counter += 1
    ans += counter - 2
print(ans)