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 math

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

res = factorization(N)

li = [0] * 101
for i in range(1, 101):
    li[i] = li[i - 1] + i

ans = 0
for r in res:
    if r[0] == 1:
        continue
    i = 0
    while li[i] <= r[1]:
        i += 1
    ans += i - 1

print(ans)

Solution (Python):
import math
def factrization_prime(number):
    factor = {}
    div = 2
    s = math.sqrt(number)
    while div < s:
        div_cnt = 0
        while number % div == 0:
            div_cnt += 1
            number //= div
        if div_cnt != 0:
            factor[div] = div_cnt
        div += 1
    if number > 1:
        factor[number] = 1
    return factor

N = int(input())
dic = factrization_prime(N)
ans = 0
for d in dic.keys():
    x = dic[d]
    minus = 1
    while(x>0):
        x -= minus
        minus += 1
        if x >= 0:
            ans += 1
print(ans)

Solution (Python):
N = int(input())
primes = {}
for num in range(2, int(N**0.5)+1):
  while N%num == 0:
    if num in primes:
      primes[num] += 1
    else:
      primes[num] = 1
    N //= num
ans = 0
for p in primes.values():
  n = 1
  while n*(n+1)//2 <= p:
    n += 1
  ans += n-1
if N > 1:
  ans += 1
print(ans)

Solution (Python):
import math
n=int(input())
def fac(n):
    arr=[]
    temp=n
    for i in range(2,math.ceil(math.sqrt(n)+1)):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp//=i
            arr.append([i,cnt])
    if temp!=1:
        arr.append([temp,1])
    if arr==[]:
        arr.append([n,1])
    return arr
l=fac(n)
if n==1:
    print(0)
else:
    ans=0
    for i in range(len(l)):
        count=l[i][1]
        p=0
        k=1
        while count>0:
            if count-k<0:
                break
            p+=1
            count-=k
            k+=1
        ans+=p
    print(ans)

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time, copy,bisect






import sys

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

stdin = sys.stdin

ni = lambda: int(ns())
nf = lambda: float(ns())
na = lambda: list(map(int, stdin.readline().split()))
nb = lambda: list(map(float, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

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 = ni()
res = factorization(N)
ans = 0
sum_ = [x for x in range(1, 200)]
for i in range(len(sum_)-1):
    sum_[i+1] += sum_[i]
for k, v in res:
    ans += bisect.bisect_right(sum_, v)
if N == 1:
    print(0)
else:
    print(ans)

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

f=factorization(n) 
l=len(f)
x=0
for i in range(l):
    x+=int((-1+math.sqrt(1+8*f[i][1]))//2)
if n==1:
    x=0
print(x)

Solution (Python):
import sys
from collections import deque, defaultdict, Counter
from itertools import accumulate, product, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right
from heapq import heappop, heappush
from math import ceil, floor, sqrt, gcd, inf
from copy import deepcopy
import numpy as np
import scipy as sp

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

INF = inf
MOD = 1000000007

n = int(input())

tmp = 0
res = 0

cnt = Counter(prime_factorize(n))
for i in cnt.values():
    res += floor((-1 + sqrt(1 + 8 * i)) / 2)

print(res)

Solution (Python):
import collections

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

if N <= 1:
  print(0)
  exit()
else:
  c = collections.Counter(prime_factorize(N))

  K = [sum(range(1,i)) for i in range(2,11)]
  
 
  for i in c:
    for j in range(1,len(K)):
      if c[i] < K[j]:
        count += j
        break

  print(count)

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

m = n
p = 2
res = 0
st = [0 for i in range(100)]
for i in range(100):
    if i * (i + 1) // 2 >= 100:
        break
    st[i * (i + 1) // 2] = i
for i in range(1, 100):
    st[i] = st[i - 1] if st[i] == 0 else st[i]

while p * p <= n:
    l = 0
    while m % p == 0:
        m //= p
        l += 1
    res += st[l]
    
    p += 1
res += m > 1
print(res)

Solution (Python):
N = int(input())
div = 2
dic = {}
while div**2 <= N:
  if N % div == 0:
    count = 0
    while N % div == 0:
      N = N // div
      count += 1
    dic[div] = count
  div += 1
if N != 1:
  dic[N] = 1
ans = 0
for v in dic.values():
  tmp = 1
  while v >= tmp:
    v -= tmp
    tmp += 1
    ans += 1
print(ans)

Solution (Python):
N=int(input())
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
l=prime_factorize(N)
L=set(l)
z=0
for j in L:
  i=1
  while i*(i+1)//2<=l.count(j):
    i+=1
  z+=i-1
print(z)

Solution (Python):
from collections import Counter

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


def main():

    N = int(input())
    cnt = Counter(prime_factorize(N))
    
    ans = 0
    for prime in cnt:
        needed = 1
        while cnt[prime] >=needed:         
            ans += 1
            cnt[prime] -= needed
            needed += 1
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
import math
def factorization(n):
  arr=[]
  temp=n
  for i in range(2,int(math.sqrt(n))):
    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()
ans=0
for i in factorization(n):
  if i[1]>=3:
    cnt=1
    while i[1]-cnt>cnt:
      ans+=1
      i[1]-=cnt
      cnt+=1
    if i[1]!=0:
      ans+=1
  else:
    ans+=1
print(ans)

Solution (Python):
def sep():
    return map(int,input().strip().split(" "))
def lis():
    return list(sep())


import random

def primesbelow(N):
    
    
    correction = N % 6 > 1
    N = {0:N, 1:N-1, 2:N+4, 3:N+3, 4:N+2, 5:N+1}[N%6]
    sieve = [True] * (N // 3)
    sieve[0] = False
    for i in range(int(N ** .5) // 3 + 1):
        if sieve[i]:
            k = (3 * i + 1) | 1
            sieve[k*k // 3::2*k] = [False] * ((N//6 - (k*k)//6 - 1)//k + 1)
            sieve[(k*k + 4*k - 2*k*(i%2)) // 3::2*k] = [False] * ((N // 6 - (k*k + 4*k - 2*k*(i%2))//6 - 1) // k + 1)
    return [2, 3] + [(3 * i + 1) | 1 for i in range(1, N//3 - correction) if sieve[i]]

smallprimeset = set(primesbelow(100000))
_smallprimeset = 100000
def isprime(n, precision=7):
    
    if n < 1:
        raise ValueError("Out of bounds, first argument must be > 0")
    elif n <= 3:
        return n >= 2
    elif n % 2 == 0:
        return False
    elif n < _smallprimeset:
        return n in smallprimeset


    d = n - 1
    s = 0
    while d % 2 == 0:
        d //= 2
        s += 1

    for repeat in range(precision):
        a = random.randrange(2, n - 2)
        x = pow(a, d, n)

        if x == 1 or x == n - 1: continue

        for r in range(s - 1):
            x = pow(x, 2, n)
            if x == 1: return False
            if x == n - 1: break
        else: return False

    return True


def pollard_brent(n):
    if n % 2 == 0: return 2
    if n % 3 == 0: return 3

    y, c, m = random.randint(1, n-1), random.randint(1, n-1), random.randint(1, n-1)
    g, r, q = 1, 1, 1
    while g == 1:
        x = y
        for i in range(r):
            y = (pow(y, 2, n) + c) % n

        k = 0
        while k < r and g==1:
            ys = y
            for i in range(min(m, r-k)):
                y = (pow(y, 2, n) + c) % n
                q = q * abs(x-y) % n
            g = gcd(q, n)
            k += m
        r *= 2
    if g == n:
        while True:
            ys = (pow(ys, 2, n) + c) % n
            g = gcd(abs(x - ys), n)
            if g > 1:
                break

    return g

smallprimes = primesbelow(1000) 
def primefactors(n, sort=False):
    factors = []

    for checker in smallprimes:
        while n % checker == 0:
            factors.append(checker)
            n //= checker
        if checker > n: break

    if n < 2: return factors

    while n > 1:
        if isprime(n):
            factors.append(n)
            break
        factor = pollard_brent(n) 
        factors.extend(primefactors(factor)) 
        n //= factor

    if sort: factors.sort()

    return factors

def factorization(n):
    factors = {}
    for p1 in primefactors(n):
        try:
            factors[p1] += 1
        except KeyError:
            factors[p1] = 1
    return factors

totients = {}
def totient(n):
    if n == 0: return 1

    try: return totients[n]
    except KeyError: pass

    tot = 1
    for p, exp in factorization(n).items():
        tot *= (p - 1)  *  p ** (exp - 1)

    totients[n] = tot
    return tot

def gcd(a, b):
    if a == b: return a
    while b > 0: a, b = b, a % b
    return a

n=int(input())
k=factorization(n)
ar=k.values()
ans=0

def find(i):
    j=1
    while((j*(j+1))//2 <= i):
        j+=1
    return j-1


for i in ar:
    ans+=find(i)
print(ans)

Solution (Python):
from collections import Counter
import math

N = int(input())
c = Counter()

for i in range(2, math.ceil(math.sqrt(N)+1)+1):
    while N%i == 0:
        c.update([i])
        N = N // i
if N!=1: c.update([N])
            
def R(n):
    ret = 0
    for i in range(1, n+1):
        if n>=i:
            ret += 1
            n -= i
        else:
            break
    return ret
 
ans = 0
for n in c:
    ans += R(c[n])
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

q = factorization(n)

ans = 0
for i in range(len(q)):
    l = q[i][1]
    if q[i][0] == 1:
        continue

    for j in range(1,l+1):
        l -= j
        if l < 0:
            break
        else:
            ans += 1
print(ans)

Solution (Python):
from math import sqrt
n=int(input())
t=0
i=2
while i*i<=n:
  if n%i==0:
    c=0
    while n%i==0:
      n//=i
      c+=1
    t+=(int(sqrt(8*c+1))-1)//2
  i+=1
if n>1:
  t+=1
print(t)

Solution (Python):
def division(n):
    if n < 2:
        return []
    prime_fac = []
    for i in range(2,int(n**0.5)+1):
        cnt = 0
        while n % i == 0:
            n //= i
            cnt += 1
        if cnt!=0:prime_fac.append((i,cnt))
    if n > 1:
        prime_fac.append((n,1))
    return prime_fac

n = int(input())
div = division(n)
ans = 0
for i,e in div:
    b = 1
    while b <= e:
        e -= b
        b += 1
        ans += 1
print(ans)

Solution (Python):
import math
import collections


def main():
    N = int(input())
    if N == 1:
        print(0)
        exit()
    limit = math.sqrt(N)
    vals = []
    i = 2
    while True:
        if i > limit:
            break
        if N % i == 0:
            vals.append(i)
            N //= i
        else:
            i += 1
    if N != 1:
        vals.append(N)
    c = collections.Counter(vals)
    ans = 0
    for v, freq in c.items():
        i = 0
        while True:
            i += 1
            freq -= i
            if freq < 0:
                break
            ans += 1
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):

def factorization(n: int) -> list:
    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 = int(input())
    if n == 1:
        print(0)
        return
    factors = factorization(n)
    ans = 0

    for _, e in factors:
        ei = 1
        while ei <= e:
            e -= ei
            ei += 1
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):

def factorization(n: int) -> list:
    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 = int(input())
    if n == 1:
        print(0)
        return
    factors = factorization(n)
    ans = 0

    for _, e in factors:
        ei = 1
        ans += 1
        while ei < e:
            e -= ei
            ei += 1
            if ei <= e:
                ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
from collections import defaultdict

N = int(input())

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

p = defaultdict(int)

while N % 2 == 0:
    p[2] += 1
    N //= 2
f = 3
while f * f <= N:
    if N % f == 0:
        p[f] += 1
        N //= f
    else:
        f += 2
if N != 1:
    p[N] += 1

ans = 0

for v in p.values():
    n = 1
    i = 1
    while n <= v:
        ans += 1
        i += 1
        n += i

print(ans)

Solution (Python):
import math
from collections import defaultdict
from itertools import accumulate
N=int(input())
data=defaultdict(int)
result=0
for i in range(2,int(math.sqrt(N))+1):
    while N%i==0:
        N//=i
        data[i]+=1
if N!=1:
    data[N]+=1
cumsum=list(accumulate(range(1,10**6*2)))
for value in data.values():
    for i in range(10**6*2):
        if value<cumsum[i]:
            result+=i
            break
if result==0:
    if N!=1:
        result=1
print(result)

Solution (Python):
import math
import numpy as np
n = int(input())

s = math.sqrt(n)
i = 2
f = {}
while i <= s:
    while n % i == 0:
        f[i] = f.get(i,0)+1
        n = n // i
    i += 1

ans = 0
for x in f.values():
    e = 0
    cumsum = 0
    while e + cumsum + 1 <= x:
        e += 1
        cumsum += e
    ans += e
print(ans+(n>1))

Solution (Python):
N = int(input())
D = {}

for k in range(2,10**6):
  while N%k<1:
    N//=k
    D[k]=D.get(k,0)+1

a = 0
for i in D.values():
  t = 0
  c = 0
  while t+c<i:
    c+=1
    t+=c
  a+=c
print(a+(N>1))

Solution (Python):
N=int(input())
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=temp//i
        
        arr.append(cnt)
if temp!=1:
    
    arr.append(1)
if arr==[] and N!=1:
    
    arr.append(1)

ans=0
for i in range(len(arr)):
    for n in range(1,100):
        if arr[i]>=n:
            ans+=1
            arr[i]-=n
        else:
            break
print(ans)

Solution (Python):
import math
def factrization_prime(number):
    factor = {}
    div = 2
    s = math.sqrt(number)
    while div < s:
        div_cnt = 0
        while number % div == 0:
            div_cnt += 1
            number //= div
        if div_cnt != 0:
            factor[div] = div_cnt
        div += 1
    if number > 1:
        factor[number] = 1
    return factor

N = int(input())
v = list(factrization_prime(N).values())
ans = 0
for i in range(len(v)):
    k = 1
    while(True):
        if v[i] >= k:
            v[i] -= k
            k += 1
            ans += 1
        else:
            break
print(ans)

Solution (Python):
import math
import random

def is_prime3(q,k=50):
    q = abs(q)
    
    if q == 2: return True
    if q < 2 or q&1 == 0: return False

    
    d = (q-1)>>1
    while d&1 == 0:
        d >>= 1

    
    for i in range(k):
        a = random.randint(1,q-1)
        t = d
        y = pow(a,t,q)
        
        while t != q-1 and y != 1 and y != q-1:
            y = pow(y,2,q)
            t <<= 1
        if y != q-1 and t&1 == 0:
            return False
    return True

def get_prime(number):
    prime_list = []
    search_list = list(range(2,number + 1))
    while search_list[0] <= math.sqrt(number):
        head_num = search_list.pop(0)
        prime_list.append(head_num)
        search_list = [num for num in search_list if num % head_num != 0]
    prime_list.extend(search_list)
    return prime_list

l = get_prime(10**6+10)
N = int(input())
ans = 0
k = 1
i = 0
l2 = []
while(l[i]**2 <= N):
    if N % (l[i]**k) == 0:
        N //= (l[i]**k)
        l2.append(l[i]**k)
        k += 1
        ans += 1
    else:
        i += 1
        k = 1
index = 0
while(index < len(l2)):
    if N % (l2[index]) == 0:
        N //= l2[index]
    else:
        index += 1
if is_prime3(N) and N not in l2:
    ans += 1
print(ans)

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





def prime_factorize(n):
    n_origin = n+0
    primelist = []
    a = 2
    while a*a <= n_origin:
        if n % a != 0:
            a += 1
            continue
        ex = 0
        while n % a == 0:
            ex += 1
            n = n//a
        primelist.append([a, ex])
        a += 1
    if n != 1:
        primelist.append([n, 1])
    return primelist


def sumf(n):
    return n*(n+1)//2


primes = prime_factorize(n)
ans = 0
for pl in primes:
    a, ex = pl
    i = 0
    while True:
        if sumf(i+1) > ex:
            break
        i += 1
    ans += i
print(ans)

Solution (Python):
N = int(input())
M = N
pf = []
K = 2

while K*K <= M:
  while N%K == 0:
    pf.append(K)
    N = N//K
  K += 1
  
if N != 1:
  pf.append(N)

ans = 0

for i in set(pf):
  C = pf.count(i)
  for j in range(20):
    if j*(j+1)//2 <= C < (j+1)*(j+2)//2:
      ans += j
  
print(ans)

Solution (Python):
memo = [[None for i in range(50)] for j in range(50)]
def opt(n,k): 
	if n < k:
		return 0
	else:
		if memo[n][k]==None:
			memo[n][k] = max(1+opt(n-k,k+1),opt(n,k+1))
		return memo[n][k]

def prime_factorize(n):
	pf = {}
	d = 2
	orig_n = n
	while d*d <= orig_n:
		while n%d==0:
			pf[d] = pf.get(d,0)+1
			n //= d
		d += 1

	if n > 1:
		pf[n] = 1
	return pf 

print(sum([opt(e,1) for e in prime_factorize(int(input())).values()]))

Solution (Python):
n = int(input())
m = n
primes = {}
 
for i in range(2, int(n**0.5+2)):
  while m % i == 0:
    m //= i
    if i not in primes:
      primes[i] = 1
    else:
      primes[i] += 1
  if i > m:
    break
 
if m != 1:
  primes[m] = 1
 
cnt = 0
num = 0
flag = True
 
while flag == True:
  num += 1
  flag = False
  for i in primes:
    if 0 < primes[i] <= num*2:
      cnt += 1
      primes[i] = 0
    elif primes[i] > num*2:
      cnt += 1
      flag = True
      primes[i] -= num
 
print(cnt)

Solution (Python):
import collections
N = int(input())
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]
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
use_list = []
cnt = 0
while True:
    flag = 0
    div_list = make_divisors(N)
    if len(div_list) == 1:
        break
    for i in range(1,len(div_list)):
        if (len(collections.Counter(prime_factorize(div_list[i]))) == 1) and (div_list[i] not in use_list):
            use_list.append(div_list[i])
            N = N //div_list[i]
            cnt +=1
            flag = 1
            break
    if flag == 0:
        break
print(cnt)

Solution (Python):
import math
from decimal import *
import random

def pf(n):
    rn = int(n)
    ans = []
    while(n%2==0):
        if(2 not in ans):
            ans.append(2)
        n//=2
    for i in range(3, int(math.sqrt(rn)), 2):
        while(n%i==0):
            if(i not in ans):
                ans.append(i)
            n//=i
            if(n==1):
                break
        if(n==1):
            break
    if(n>2):
        ans.append(n)
    return sorted(ans)
n = int(input())
d = pf(n)
if(d=={}):
    print(1)
else:
    ans = 0
    for i in range(len(d)):
        cnt = 1
        while(n >= d[i]**cnt):
            if(n%(d[i]**cnt)==0):
                n//=(d[i]**cnt)
                ans+=1
            cnt+=1
    print(ans)

Solution (Python):
import bisect

N=int(input())
ans=0
i=2
a=[j*(j+1)//2 for j in range(64)]
while i*i<=N:
    cnt=0
    while N%i==0:
        N//=i
        cnt+=1
    ans+=bisect.bisect_right(a,cnt)-1
    i+=1
if N>1:
    ans+=1
print(ans)

Solution (Python):
def div(n):
    i = 2
    a = n
    D = {}
    tmp = 1
    while i*i <= n:
        cnt = 0
        while a%i == 0:
            a = a // i
            tmp *= i
            cnt += 1
        if cnt > 0:
            D[i] = cnt
        i += 1
    if tmp != n:
        D[n] = 1
    return D

N = int(input())
D = div(N)
ans = 0
for v in D.values():
    i = 1
    total = 1
    while v >= total+(i+1):
        i += 1
        total += i
    ans += i

print(ans)

Solution (Python):
import math , sys

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
def sta ( x ):
    return int( 0.5* (-1 + math.sqrt(1+8*x)))
N = int( input() )

if N == 1:
    print(0)
    sys.exit()
if N == 2 or N ==3:
    print(1)
    sys.exit()
Is = fac( N )
ans = sum( [ sta(j) for j in Is])
print(max(ans,1))

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())
fac = factorization(N)
result = 0
for div in fac:
    if div[0] == 1:
        continue
    i = 1
    count = 1
    while i <= div[1]:
        result += 1
        count += 1
        i += count

print(result)

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

def divisor(x):
    div=[]
    for i in range(1,int(x**(1/2))+1):
        if x%i==0:
            div.append(i)
            if i!=x//i:
                div.append(x//i)
    return sorted(div)

def factorization(n):
    arr=[]
    temp=n
    for i in range(2,int(n**(1/2))+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

zt=[1]
ans=0
while N>1:
    for i in divisor(N):
        if i not in zt:  
            if len(factorization(i))==1:
                z=i
                zt.append(z)
                break
    if z==0:
        break
    N=N//z
    ans+=1
    z=0

print(ans)

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

factors = []
for i in range(2, min(int(n ** 0.5 + 1), n + 1)):
  if n % i == 0:
      factors.append(i)
      factors.append(n // i)

factors.sort()

for factor in factors:
    while n % factor == 0:
        n //= factor
        f[factor] += 1

 
    
def bsearch(test, lo, hi):
  while lo != hi:
    mid = (lo + hi + 1) // 2
    if test(mid):
      lo = mid
    else:
      hi = mid - 1
  return lo
 
ans = 0
for p, q in f.items():
  ans += bsearch(lambda w: w * (w + 1) // 2 <= q, 0, 10 ** 12)
 
if ans == 0 and n > 1:
    print(1)
else:
    print(ans)

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


pf = []
for i in range(2,math.ceil(n**0.5)+1):
    temp = 0
    while n%i==0:
        n /= i
        temp += 1
    if temp:
        pf.append(temp)
    if n==1:
        break
if n!=1:
    pf.append(1)

ans =  0
for i in range(len(pf)):
    j = 1
    while pf[i]-j>=0:
        ans += 1
        pf[i] -= j
        j += 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
ans = 0
l = factorization(N)
for i,j in l:
    k = 1
    while j >= k:
        ans += 1
        j -= k
        k += 1
print(ans)

Solution (Python):
from sys import stdin
def solve():
    n = int(stdin.readline())
    ans = 0
    if n == 1: return 0
    prime = {}
    i = 2
    while i**2 <= n:
        if n%i != 0:
            i += 1
            continue
        ex = 0
        while n%i == 0:
            ex += 1
            n //= i
        prime[i] = ex
    if n != 1: prime[n] = 1
    for key in prime:
        cur = 1
        while prime[key] >= cur:
            ans += 1
            prime[key] -= cur
            cur += 1
    return ans

print(solve())

Solution (Python):
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines

from math import sqrt, floor
def main():
    def factorization(n):
        l = []
        t = n
        for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
            if t % i == 0:
                cnt = 0
                while t % i == 0:
                    cnt += 1
                    t = t // i
                l.append([i, cnt])
        if t != 1:
            l.append([t, 1])
        if not l:
            l.append([n, 1])
        return l
    n = int(input())
    if n == 1:
        print(0)
        sys.exit()
    p = factorization(n)
    r = 0
    for pe in p:
        pe1 = pe[1]
        cnt = 1
        while pe1 >= cnt:
            pe1 -= cnt
            cnt = cnt + 1
            r += 1
    print(r)

if __name__ == '__main__':
    main()

Solution (Python):
from collections import Counter
def aprime_factorize(n: int) -> list:
    return_list = []
    while n % 2 == 0:
        return_list.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            return_list.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        return_list.append(n)
    return return_list

judge = []
cnt = 0
while len(judge) <= 40:
    for i in range(cnt+1):
        judge.append(cnt)
    cnt += 1
N = int(input())
list = Counter(aprime_factorize(N)).most_common()
res = 0
for i, li in enumerate(list):
    res += judge[li[1]]
print(res)

Solution (Python):
from collections import defaultdict
from math import sqrt

def main():
    n = int(input())
    wi = 2
    cnt = 0
    d = defaultdict(lambda:0)
    fi = int(sqrt(1e12)+1)
    for i in range(2, fi):
        while n % i == 0:
            d[i] += 1
            n //= i
    if n != 1:
        d[n] = 1

    for val in d.values():
        x = val
        wi = 1
        while(x >= wi):
            x -= wi
            wi += 1
            cnt += 1
    print(cnt)


if __name__ == "__main__":
    main()

Solution (Python):
def factorize(n):
    lst = []
    tmp = n

    for i in range(2, int(n ** 0.5) + 1):
        if tmp % i == 0:
            cnt = 0
            while tmp % i == 0:
                tmp //= i
                cnt += 1
            lst.append([i, cnt])

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

    return lst


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

    lst = factorize(n)
    ans = 0

    for l in lst:
        for i in range(1, 10 ** 6 + 1):
            if i * (i + 1) // 2 > l[1]:
                ans += i - 1
                break

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):

N=int(input())

def factorization(N):
    res=[]
    for i in range(2,int(N**(1/2))+2):
        if not N%i:
            r=0
            while not N%i:
                N//=i
                r+=1
            res.append((i,r))
    if N>1:
        res.append((N,1))
    return res

fact=factorization(N)

res=0
for p,r in fact:
    i=1
    while 1:
        if i*(i+1)//2<= r < (i+1)*(i+2)//2:
            break
        else:
            i+=1
    res+=i
print(res)