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 numpy as np
import sys

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

d = int(N ** .5)

def eratosthenes(N):
	is_prime = [True] * (N + 1)
	is_prime[0], is_prime[1] = False, False
	for i in range(2, int(N**(1/2)) + 1):
		if is_prime[i]:
			for j in range(i * 2, N + 1, i):
				is_prime[j] = False
	return [i for i in range(N+1) if is_prime[i]]

p_num = eratosthenes(d+1)
MAX_p = p_num[-1]
ans = 0
used = []
for p in p_num:
    t_p = p
    while N % p == 0:
        N //= p
        ans += 1
        p *= t_p
    if p != t_p:
        used.append(t_p)

for p in used:
    while N % p == 0:
        N //= p

if N > MAX_p:
    dd = int(N ** .5)
    cond = 1
    for i in range(2, dd+1):
        if N % i == 0:
            cond = 0
            break
    if cond:
        ans += 1
    
print(ans)

Solution (Python):

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)

    
    return divisors


def soinsu_bunkai(m):
    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
    return pf


N = int(input())
div =make_divisors(N) 
div.sort()
div_1_except=div[1:]
count =0
for i in div_1_except:
    q,mod= divmod(N,i)
    if mod ==0:
        ii =soinsu_bunkai(i) 
        if len(ii) ==1 :
            count +=1
            N =q   

print(count)

Solution (Python):

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)

    
    return divisors


def soinsu_bunkai(m):
    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
    return pf


import sys
input = sys.stdin.readline
N = int(input())
div =make_divisors(N)
div.sort()
div_2 =div[1:]

count =0
for i in div_2:
    i2 = soinsu_bunkai(i)
    if len(i2) ==1:
        q,mod =divmod(N,i)
        if mod ==0:
            count +=1
            N =q
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)

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

    return arr

ans = 0
X = int(input())
Y = factorization(X)
Y.sort()
Z = X
for i in range(len(Y)):
  if X % Y[i] == 0:
    ans += 1
    X /= Y[i]
    
if Z == 1:
  print(0)
else:
  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())
A = factorization(N)
if N == 1:
  print(0)
  exit()
ans = 0
for a,b in A:
    if b < 3:
        ans += 1
    elif b < 6:
        ans += 2
    elif b < 10:
        ans += 3
    elif b < 15:
        ans += 4
    elif b < 21:
        ans += 5
    elif b < 28:
        ans += 6
    elif b < 36:
        ans += 7
    elif b < 45:
        ans += 8
    else:
        ans += 9
print(ans)

Solution (Python):
import math

N = int(input())

x = N
n = math.floor(math.sqrt(N))
p = {}
i = 2

while i <= n:
    while x % i == 0:
        p.setdefault(i, 0)
        p[i] += 1
        x //= i
    i += 1

if x != 1:
    p.setdefault(x, 1)

ans = 0

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

print(ans)

Solution (Python):
n = int(input())
limit = n**0.5
q = 2

if n == 1:
    print(0)
else:
    ans = 0
    while q < limit:
        cnt = 0
        while n % q == 0:
            cnt += 1
            n /= q
        if cnt > 0:
            ans += int((2*cnt + 0.25)**0.5 - 0.5)
            limit = n**0.5
        q += 1
    if n > 1:
        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([i, cnt])

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

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

    return arr

n = int(input())
a = factorization(n)
ans = 0
if n == 1:
    ans = -1
for i in a:
    ans += 1
    k = 2
    l = i[1] - 1
    while l >= k:
        ans += 1
        l -= k
        k += 1
print(ans)

Solution (Python):
N = int(input())
 
def prime_factorization(N):
  n = int(N**0.5)+1
  numList = [i if i != 1 else 2 for i in range(1, n, 2) ]
  primeList = [2]
  ansDict = {}
  idx = 0
  for data in numList:
    for x in primeList:
      if (data%x != 0 or x == 2):
        count = 0
        while N%data == 0:
          count += 1
          N //= data
        if count > 0:
          ansDict[data] = count
        if N == 1:
          return ansDict
        if x != 2:
          primeList.append(data)
        break
  if N != 1:
    ansDict[N] = 1
  
  return ansDict 

if N <= 1:
  print(0)
  exit()
  
ansDict = prime_factorization(N)
ansCount = 0
for p,v in ansDict.items():
  e = 1
  while e <= v:
    ansCount += 1
    v -= e 
    e += 1  

print(ansCount)

Solution (Python):
target = int(input())
num = target
waru = 2
exp = []
while waru ** 2 <= target and num > 1:
    rep = 0
    while num % waru == 0:
        num /= waru
        rep += 1
    waru += 1
    if rep > 0:
        exp.append(rep)
if num > 1:
    exp.append(1)
ans = 0
for item in exp:
    hiku = 1
    while item - hiku >= 0:
        item -= hiku
        ans += 1
        hiku += 1
print(ans)

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

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


import collections
c = collections.Counter(prime_factorize(N))

tmp = []
for i in range(1,40):
    tmp.append((1+i)*i//2)
import bisect
ans = 0
for i in list(c.values()):
    ans += bisect.bisect_right(tmp,i)
print(ans)

Solution (Python):
import collections



def prime_factorize(n: int) -> list:
    """
    整数 n を素因数分解する
    :param n: 整数
    :return a:リスト
    """
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f <= n ** 0.5:
        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))
count = 0
for i in c.values():
    if i == 1:
        count += 1
    else:
        s = 1
        while i > 0:
            i = i - s
            s += 1
            if i < 0:
                break
            count += 1

print(count)

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

i = 2
tmp = N

ans = 0
while i*i <= N:
    cnt = 0
    while tmp % i == 0:
        tmp //= i
        cnt += 1
    if cnt > 0:
        k = 1
        while cnt - k >= 0:
            cnt -= k
            ans += 1
            k += 1
    i += 1
if tmp != 1:
    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 countf(e):
    v=0
    count=0
    while True:
        if v+(count+1)>e:
            break
        count+=1
        v+=count
    return count

primel=prime_factorize(n)
ans=0

for l in primel:
    p,e=l
    ans+=countf(e)

print(ans)

Solution (Python):
import sys
input = sys.stdin.readline


def prime_factor_count(n):
    def count(n, p):
        cnt = 0
        while n % p == 0:
            n //= p
            cnt += 1
        np_cnt = 1
        while (cnt := cnt - np_cnt) >= 0:
            np_cnt += 1
        return n, np_cnt - 1

    n, cnt = count(n, 2)

    if n == 1:
        return cnt

    for i in range(3, int(n ** 0.5) * 1, 2):
        n, tmp_cnt = count(n, i)
        cnt += tmp_cnt
        if n == 1:
            break
    else:
        cnt += 1

    return cnt


def main():
    n = int(input())
    ans = prime_factor_count(n)
    print(ans)


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))
for i in c.values():
    j = 1
    while True:
        i -= j
        j += 1
        ans += 1
        if i - j < 0:
            break
print(ans)

Solution (Python):
import numpy as np

def seachPrimeNum(MAX):
    prime = np.zeros(MAX, np.bool_)
    prime[2] = 1
    prime[3::2] = 1
    for p in range(3, MAX, 2):
        if p * p >= MAX:
            break
        if prime[p]:
            prime[p * p::p + p] = 0
    
    return prime.nonzero()[0]

N = int(input())
n = N
s = 0

prime = np.array(seachPrimeNum(int(np.sqrt(10**12))))
prime = prime[N % prime == 0]

for p in prime:
    e = 1
    while n % p == 0:
        if n % p ** e == 0:
            n = n / p ** e
            e = e + 1
            s += 1
        else:
            n = n / p

if n != 1:
    s += 1

print(s)

Solution (Python):
def my_prime(n:int):
    if n <= 1:
        return {}
    fac = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            while temp%i==0:
                temp //= i
            fac.append(i)
    if temp!=1:
        fac.append(temp)
    if fac==[]:
        fac.append(n)
    return fac
n = int(input())
temp = n
cnt = 0
for x in my_prime(n):
    i=1
    while x**i <= n:
        if temp % x**i == 0:
            cnt += 1
            temp = temp // x**i
        i += 1
print(cnt)

Solution (Python):
import sys
import math
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
from collections import deque
from bisect import bisect_left
from itertools import product
def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]

def LSI(): return list(map(int, list(sys.stdin.readline().rstrip())))
def LSI2(N): return [list(map(int, list(sys.stdin.readline().rstrip()))) for i in range(N)]

def ST(): return sys.stdin.readline().rstrip()
def LST(): return sys.stdin.readline().rstrip().split()
def LST2(N): return [sys.stdin.readline().rstrip().split() for i in range(N)]
def FILL(i,h): return [i for j in range(h)]
def FILL2(i,h,w): return [FILL(i,w) for j in range(h)]
def FILL3(i,h,w,d): return [FILL2(i,w,d) for j in range(h)]
def FILL4(i,h,w,d,d2): return [FILL3(i,w,d,d2) for j in range(h)]
def sisha(num,digit): return Decimal(str(num)).quantize(Decimal(digit),rounding=ROUND_HALF_UP)

MOD = 1000000007
INF = float("inf")
sys.setrecursionlimit(10**6+10)
import math

def isPrime(num):
    for i in range(3,math.floor(math.sqrt(num))+1,2):
        if num%i==0:
            return False
    return True


N = I()
cnt = 0
ans = 0
while N%2==0:
    N /= 2
    cnt += 1
power = 1
while cnt-power>=0:
    cnt -= power
    ans += 1
    power += 1
while True:
    if N==1:
        break
    if isPrime(N):
        ans += 1
        break
    else:
        for i in range(3,math.floor(math.sqrt(N))+1,2):
            cnt = 0
            if isPrime(i) and N%i==0:
                while N%i==0:
                    N /= i
                    cnt += 1
                power = 1
                while cnt-power>=0:
                    cnt -= power
                    ans += 1
                    power += 1

print(ans)

Solution (Python):
from subprocess import*
p=run(('factor',input()),stdout=PIPE).stdout.split()
print(sum(int((8*p.count(i)+1)**.5/2-.5)for i in set(p))-1)

Solution (Python):
from subprocess import*
p=run(('factor',input()),stdout=PIPE).stdout.split()[1:]
print(sum(int((8*p.count(i)+1)**.5/2-.5)for i in set(p)))

Solution (Python):
from subprocess import*
p=run(('factor',input()),stdout=PIPE).stdout.split()[1:]
print(sum(int((8*p.count(i)+1)**.5/2-.5)for i in set(p)))

Solution (Python):
def resolve():
	from collections import Counter

	def prime_factorize(n):
		a = []
		i = 2
		while i < n**(1/2) + 1:
			if n%i == 0:
				n //= i
				a.append(i)
			else:
				i += 1
		if n != 1:
			a.append(n)
		return a
	
	def cnt(x):
	    ans = 0
	    i = 1
	    while True:
	        ans += i
	        if ans > x:
	            return i-1
	        i += 1
	        
	n = int(input())
	ans = 0

	a = Counter(prime_factorize(n))
	for i in a.values():
	    ans += cnt(i)

	print(ans)

resolve()

Solution (Python):
def resolve():
	from collections import Counter

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

	def cnt(x):
	    ans = 0
	    i = 1
	    while True:
	        ans += i
	        if ans > x:
	            return i-1
	        i += 1
	        
	n = int(input())
	ans = 0

	a = Counter(prime_factorize(n))
	for i in a.values():
	    ans += cnt(i)

	print(ans)
	
resolve()

Solution (Python):
from subprocess import*
p=run(('factor',input()),capture_output=1).stdout.split()[1:]
print(sum(int(((8*p.count(i)+1)**.5-1)/2)for i in set(p)))

Solution (Python):
from collections import Counter


class Factorize:
    def __init__(self):
        self.primes = Counter()

    def add_target(self, n):
        for i in range(2, int(n**0.5)+1):
            while n%i==0:
                self.primes[i] += 1
                n //= i
            if not n:
                break
        if n>1:
            self.primes[n] += 1
    
    def get_result(self):
        return dict(self.primes)


N = int(input())
f = Factorize()
f.add_target(N)

d = f.get_result()
ans = 0
for i in d.values():
    for j in range(i+1):
        if j*(j+1)//2>i:
            j-=1
            break
    ans += j
print(ans)

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

from collections import Counter

factors = []
i = 2
while n > 1:
   if n < i * i:
      factors.append(n)
      break
   while n % i == 0:
      factors.append(i)
      n //= i
   i += 1

ans = 0
for cnt in Counter(factors).values():
   i = 1
   while cnt >= i:
      cnt -= i
      i += 1
      ans += 1
print(ans)

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

def primes_factraizar(n):
    rn = int(n**0.5)
    is_prime = [True] * (rn+1) 
    is_prime[0] = False 
    is_prime[1] = False
    for i in range(2, rn + 1): 
        if not is_prime[i]: 
            continue            
        for j in range(i * 2, rn + 1, i): 
            is_prime[j] = False
    return [i for i in range(rn + 1) if is_prime[i]]
primes = primes_factraizar(n)

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



div = []
for i in primes:
    for j in range(1000):
        if n%i==0:
            n=n//i
        else:
            if j == 0:
                break
            div.append(j)
            break
if n != 1:
    div.append(1) 

if div == []:
    print(1)
    exit()
ans = 0
for i in div:
    c = 0
    for j in range(1,10**9):
        if i >= c+j:
            c+=j
        else:
            ans += j-1
            break
print(ans)

Solution (Python):
"""
- Nを素因数分解する
- N = p[i]^1*p[i]^2...*p[k]^1*p[k]^2...
"""
from collections import Counter
N = int(input())
factors = []
i = 2

while N > 1:
  if N < i * i:
    factors.append(N)
    break
  while N % i == 0:
    factors.append(i)
    N //= i
  i += 1

ans = 0

for count in Counter(factors).values():
  i = 1
  while count >= i:
    count -= i
    i += 1
    ans += 1
print(ans)

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

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

f = factorize(N)
ans = 0
for p, i in f:
    j = 0
    while i > j:
        j += 1
        i -= j
        ans += 1
print(ans)

Solution (Python):
from math import gcd
from collections import Counter

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

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

count = Counter(factorize(n))
ans=0
for key in count:
    sum=0
    for i in range(1,100000):
        sum+=i
        if count[key] >= sum and count[key] < sum+i+1:
            ans+=i
            break
        else:
            continue
print(ans)

Solution (Python):
import math
import sys
def input():
    return sys.stdin.readline().rstrip('\n')

def get_e(x):
    l = []
    i = 2
    m = math.floor(math.sqrt(x))
    while i <= m and i <= x:
        if x % i == 0:
            x = x // i
            l += [i]
        else:
            i += 1
    if x != 1:
        l += [x]
    return l

def calc(N):
    d = {}
    for i in get_e(N):
        d[i] = 1 + (d[i] if i in d else 0)
    result = 0
    for i in d:
        result += math.floor((math.sqrt(1 + 8 * d[i]) - 1) / 2)
    return result
    

N = int(input())
print(calc(N))

Solution (Python):
def func(N):
    tmp=N
    arr=[]
    for i in range(2,int((N**0.5//1))+1):
        if tmp%i==0:
            cnt=0
            while tmp%i==0:
                cnt+=1
                tmp//=i
            arr.append([i,cnt])
            
    if tmp!=1 or arr==[]:
        arr.append([tmp, 1])
    return arr

N=int(input())
a=func(N)
ans=0
if a[0][0]==1:
        print(0)
        exit()
        
b=[1,3,6,10,15,21,28,36,45]
for i in a:
    for j in range(len(b)):
       if  i[1]<b[j]:
          ans+=j
          break
print(ans)

Solution (Python):
def func(N):
    tmp=N
    arr=[]
    for i in range(2,int((N**0.5//1))+1):
        if tmp%i==0:
            cnt=0
            while tmp%i==0:
                cnt+=1
                tmp//=i
            arr.append([i,cnt])
            
    if tmp!=1:
        arr.append([tmp, 1])
    if arr==[]:
        arr.append([tmp,1])
   
    return arr

N=int(input())
a=func(N)
ans=0
if a[0][0]==1:
        print(0)
        exit()
        
b=[1,3,6,10,15,21,28,36,45]
for i in a:
    for j in range(len(b)):
       if  i[1]<b[j]:
          ans+=j
          break
print(ans)

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

N=int(input())
a=func(N)
ans=0
if a[0][0]==1:
        print(0)
        exit()
        
b=[1,3,6,10,15,21,28,36,45]
for i in a:
    for j in range(len(b)):
       if  i[1]<b[j]:
          ans+=j
          break
print(ans)

Solution (Python):
def factorization(n):
    m=n
    counter_map={}
    i=2
    tmp=1
    flag=True
    while n!=1:
        
        if n%i==0:
            flag=False
            n=n//i
            
            for j in range(2,int(i**(1/2))+1):
                if i%j==0:
                    break
            else:
                tmp*=i
                if i not in counter_map:
                    counter_map[i]=1
                    tmp=1
                else:
                    if tmp not in counter_map:
                        counter_map[tmp]=1
                        tmp=1
        else:
            i+=1
            tmp=1
            flag=True
        if i>int(n**(1/2))+1 and n!=1 and flag:
            counter_map[n]=1
            break
        
    return counter_map


a=int(input())
b=factorization(a)














print(len(b))

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
  
from collections import Counter
n=int(input())
s=Counter(prime_factorize(n))
t=list(s.values())
cnt=0


for i in t:
  if i==1:
    cnt+=1
    
  else:
    s=1
    while i>0:
      i=i-s
      s+=1
      if i<0:
        break
      cnt+=1
      
print(cnt)

Solution (Python):
def factorization(n):
    m=n
    counter_map={}
    i=2
    tmp=1
    while n!=1:
        
        if n%i==0:
            n=n//i
            
            for j in range(2,int(i**(1/2))+1):
                if i%j==0:
                    break
            else:
                tmp*=i
                if i not in counter_map:
                    counter_map[i]=1
                    tmp=1
                else:
                    if tmp not in counter_map:
                        counter_map[tmp]=1
                        tmp=1
        else:
            i+=1
            tmp=1
        if i>int(m**(1/2)) and n!=1:
            counter_map[n]=1
            break
    return counter_map


a=int(input())
b=factorization(a)
sum=0

for i in b.keys():
    counter=0
    for j in range(1,41):
        if b[i]>=1+(j+2)*(j-1)//2:
            counter=j
        else:
            break
    sum+=counter

print(sum)

Solution (Python):
def factorization(n):
    m=n
    counter_map={}
    i=2
    tmp=1
    while n!=1:
        
        if n%i==0:
            n=n//i
            
            for j in range(2,int(i**(1/2))+1):
                if i%j==0:
                    break
            else:
                tmp*=i
                if i not in counter_map:
                    counter_map[i]=1
                    tmp=1
                else:
                    if tmp not in counter_map:
                        counter_map[tmp]=1
                        tmp=1
        else:
            i+=1
            tmp=1
        if i>int(m**(1/2)) and n!=1:
            counter_map[n]=1
            break
    return counter_map


a=int(input())
b=factorization(a)
sum=0

for i in b.keys():
    counter=0
    for j in range(1,41):
        if b[i]>=1+(j+2)*(j-1)//2:
            counter=j
        else:
            break
    sum+=counter

print(sum)

Solution (Python):
def factorization(n):
    m=n
    counter_map={}
    i=2
    tmp=1
    while n!=1:
        
        if n%i==0:
            n=n//i
            
            for j in range(2,int(i**(1/2))+1):
                if i%j==0:
                    break
            else:
                tmp*=i
                if i not in counter_map:
                    counter_map[i]=1
                    tmp=1
                else:
                    if tmp not in counter_map:
                        counter_map[tmp]=1
                        tmp=1
        else:
            i+=1
            tmp=1
        if i>int(m**(1/2)) and n!=1:
            counter_map[n]=1
            break
        
    return counter_map


a=int(input())
b=factorization(a)


print(len(b))

Solution (Python):
def factorization(n):
    m=n
    counter_map={}
    i=2
    tmp=1
    while n!=1:
        
        if n%i==0:
            n=n//i
            
            for j in range(2,int(i**(1/2))+1):
                if i%j==0:
                    break
            else:
                tmp*=i
                if i not in counter_map:
                    counter_map[i]=1
                    tmp=1
                else:
                    if tmp not in counter_map:
                        counter_map[tmp]=1
                        tmp=1
        else:
            i+=1
            tmp=1
        if i>int(m**(1/2)) and n!=1:
            counter_map[n]=1
            break
        
    return counter_map


a=int(input())
b=factorization(a)

print(len(b))

Solution (Python):
def factorization(n):
    m=n
    counter_map={}
    i=2
    tmp=1
    while n!=1:
        
        if n%i==0:
            n=n//i
            
            for j in range(2,int(i**(1/2))+1):
                if i%j==0:
                    break
            else:
                tmp*=i
                if i not in counter_map:
                    counter_map[i]=1
                    tmp=1
                else:
                    if tmp not in counter_map:
                        counter_map[tmp]=1
                        tmp=1
        else:
            i+=1
            tmp=1
        if i>int(m**(1/2)) and n!=1:
            counter_map[n]=1
            break
        
    return counter_map


a=int(input())
b=factorization(a)

sum=0












print(len(b))

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

def factorization(n):
    arr = []
    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

f_list = factorization(n)
ans = 0

for i in range(len(f_list)):
    tmp = f_list[i][1]
    j = 1
    while tmp >= 0:
        tmp -= j
        j += 1
    ans += j-2

print(ans)

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

def factorization(n):
    arr = []
    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

f_list = factorization(n)
ans = 0

for i in range(len(f_list)):
    _tmp = f_list[i][1]
    j = 1
    while _tmp >= 0:
        _tmp -= j
        j += 1
    ans += j-2

print(ans)

Solution (Python):
from itertools import accumulate
from collections import defaultdict


def main():
    n = int(input())
    prime_counter = defaultdict(int)  
    
    accum = tuple(accumulate(range(10)))

    def facs(n):
        yield 2
        max_prime = int(pow(n, 0.5)) + 1
        for x in range(3, max_prime, 2):
            yield x

    for fac in facs(n):
        while n % fac == 0:
            n //= fac
            prime_counter[fac] += 1
    if n != 1:
        prime_counter[n] += 1

    ans = 0
    for c in prime_counter.values():
        for accum_count, accum_value in enumerate(accum):
            if c < accum_value:
                ans += accum_count - 1
                break
    print(ans)


if __name__ == '__main__':
    main()

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

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

n = 0
for p, e in arr:
  temp = e
  j = 0
  while temp > 0:
    j += 1
    temp = temp - j
    if temp < 0:
      break
    n += 1

print(n)

Solution (Python):
from itertools import accumulate
from collections import defaultdict


def main():
    n = int(input())
    prime_counter = defaultdict(int)  
    accum = tuple(accumulate(range(1, 10)))  

    def facs(n):
        yield 2
        for x in range(3, int(pow(n, 0.5)) + 1, 2):
            yield x

    for fac in facs(n):
        while n % fac == 0:
            n //= fac
            prime_counter[fac] += 1
    if n != 1:
        prime_counter[n] += 1

    ans = 0
    for c in prime_counter.values():
        for accum_count, accum_value in enumerate(accum):
            if c < accum_value:
                break
        ans += accum_count
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
from itertools import accumulate
from collections import defaultdict


def main():
    n = int(input())
    prime_counter = defaultdict(int)  
    accum = tuple(accumulate(range(1, 38)))  

    def facs(n):
        yield 2
        for x in range(3, int(pow(n, 0.5)) + 1, 2):
            yield x

    for fac in facs(n):
        while n % fac == 0:
            n //= fac
            prime_counter[fac] += 1
    if n != 1:
        prime_counter[n] += 1

    ans = 0
    for c in prime_counter.values():
        for accum_count, accum_value in enumerate(accum):
            if c < accum_value:
                break
        ans += accum_count
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
from itertools import accumulate
from collections import defaultdict


def main():
    n = int(input())
    prime_counter = defaultdict(int)  
    accum = tuple(accumulate(range(1, 40)))  

    def facs(n):
        yield 2
        for x in range(3, int(pow(n, 0.5)) + 1, 2):
            yield x

    for fac in facs(n):
        while n % fac == 0:
            n //= fac
            prime_counter[fac] += 1
    if n != 1:
        prime_counter[n] += 1

    ans = 0
    for c in prime_counter.values():
        for accum_count, accum_value in enumerate(accum):
            if c < accum_value:
                break
        ans += accum_count
    print(ans)


if __name__ == '__main__':
    main()