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 sys
input = sys.stdin.buffer.readline




def RD(): return input().rstrip().decode()
def II(): return int(input())
def FI(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))


from collections import defaultdict

def main():
	n=II()
	d=defaultdict(int)

	while n%2==0:
		d[2]+=1
		n//=2

	f=3
	while f*f<=n:
		if n%f==0:
			d[f]+=1
			n//=f
		else:
			f+=2

	if n!=1:
		d[n]+=1

	

	ans=0

	for _,v in d.items():
		for i in range(1,10000):
			if (i*(i+1))//2>v:
				ans+=i-1
				break
	print(ans)
















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

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

factors = factorization(N)

ans = 0
for factor in factors:
    num = factor[1]
    x = 1
    for i in range(num+1):
        if i**2 + i > 2*num:
            x = i-1
            break

    ans += x

print(ans)

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


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


num = [i for i in range(1, 65)]
num = list(accumulate(num))

N = int(input())
primes = Counter(factor(N))
ans = 0
for v in primes.values():
    ans += bisect_right(num, v)
print(ans)

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))


def prime_factorize(n):
    if n == 1:
        return [1]
    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 = inp()
c = Counter(prime_factorize(n))
res = 0

for k,v in c.items():
    if k == 1: continue
    cnt = 0
    for now in range(1,150000):
        cnt += now
        if cnt > v:
            res += now-1
            break
print(res)

Solution (Python):
P = [1 for _ in range(10**6)]
P[0]=0
P[1]=0
for i in range(2,10**3):
    for j in range(i*i,10**6,i):
        P[j] = 0
Q = []
for i in range(2,10**6):
    if P[i]==1:
        Q.append(i)
N = int(input())
C = {}
for q in Q:
    if N%q==0:
        C[q] = 0
        while N%q==0:
            N = N//q
            C[q] += 1
if N>1:
    C[N] = 1
cnt = 0
for q in C:
    k = C[q]
    n = 1
    while k>(n*(n+1))//2:
        n += 1
    if k==(n*(n+1))//2:
        cnt += n
    else:
        cnt += n-1
print(cnt)

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

N = int(input())
c = collections.Counter(prime_factorize(N))
sums = []
s=1
ans = 0
for v in c.values():
  count = 0
  for i in range(1,v+1):
    if count+i > v:
      break
    else:
      count += i
      ans += 1
print(ans)

Solution (Python):
from collections import Counter
import math
N = int(input())
Nso = []
Nruto = math.sqrt(N)
Nruto = math.floor(Nruto)
for i in range(2, Nruto+1):
    while N % i == 0:
        N = N//i
        Nso.append(i)
    if N == 1:
        break
    Nruto = math.sqrt(N)
    Nruto = math.floor(Nruto)
Nso.append(N)
if 1 in Nso:
    Nso.remove(1)
Nso = Counter(Nso)
ans = 0
for v in Nso.values():
    count = 0
    for i in range(1, v+1):
        if count+i > v:
            break
        else:
            count += i
            ans += 1

print(ans)

Solution (Python):



from fractions import gcd
from itertools import combinations,permutations,accumulate, product 

from collections import deque,defaultdict,Counter
import decimal
import re
import math















import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7


from sys import stdin
readline = stdin.readline
def readInts():
  return list(map(int,readline().split()))
def readTuples():
    return tuple(map(int,readline().split()))
def I():
  return int(readline())
n = I()
def soinsu(n):
    dic = defaultdict(int)
    i = 2
    while i*i <= n:
        if n%i == 0:
            dic[i] += 1
            n //= i
        else:
            i += 1
    if n!= 1:
        dic[n] += 1
    return dic
dic = soinsu(n)
ans = 0
for k,v in dic.items():
    i = 1
    while True:
        if v >= i:
            ans += 1
            v -= i
            i += 1
        else:
            break
print(ans)

Solution (Python):
P = [1 for _ in range(10**6)]
P[0]=0
P[1]=0
for i in range(2,10**3):
    for j in range(i*i,10**6,i):
        P[j] = 0
Q = []
for i in range(2,10**6):
    if P[i]==1:
        Q.append(i)
N = int(input())
C = {}
for q in Q:
    if N%q==0:
        C[q] = 0
        while N%q==0:
            N = N//q
            C[q] += 1
if N>1:
    C[N] = 1
cnt = 0
for q in C:
    k = C[q]
    n = 1
    while k>(n*(n+1))//2:
        n += 1
    if k==(n*(n+1))//2:
        cnt += n
    else:
        cnt += n-1
print(cnt)

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

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

def is_prime(n):
    if n <= 1: return False
    for i in range(2, int(n**0.5) + 1):
        if n%i == 0: return False
    return True

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n%i == 0:
            divisors.append(i)
            if i!=n//i:
                divisors.append(n//i)
    divisors.sort()
    return divisors
 
ans = []
cnt = 0
X = make_divisors(n)[1:]
for x in X:
    if is_prime(x):
        ans.append(x)
        n //= x
        cnt += 1
        e = 2
        while x**e < n:
            ans.append(x**e)
            e += 1
    elif x in ans:
        if n%x == 0:
            n //= x
            cnt += 1
print(cnt)

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

d = defaultdict(int)

i = 2
while i * i <= n:
    while n % i == 0:
        d[i] += 1
        n /= i
    i += 1
if n != 1:
    d[n] += 1

ans = 0
for v in d.values():
    
    x = 0
    while (x + 1) * (x + 2) // 2 <= v:
        x += 1
    ans += x
print(ans)

Solution (Python):
def prime_decomposition(n):
    
    i = 2
    table = []
    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

from itertools import groupby
from collections import Counter
import sys
input = sys.stdin.readline

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

    ans = 0
    table = prime_decomposition(N)
    for _, cnt in table:
        i = 1
        while cnt >= i:
            cnt -= i
            i += 1
            ans += 1

    print(ans)

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


def abc169d_div_game():
    n = int(input())
    arr = factorization(n)
    cnt = 0
    for p, e in arr:
        if p == 1: continue
        for i in range(1, e+1):
            if e >= i:
                cnt += 1
                e -= i
            else:
                break
    print(cnt)

abc169d_div_game()

Solution (Python):
import math
import collections
def prime_diviation(n):
    factors = []
    i = 2
    while i <= math.floor(math.sqrt(n)):
        if n%i == 0:
            factors.append(int(i))
            n //= i
        else:
            i += 1
    if n > 1:
        factors.append(n)
    return factors

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

pr = prime_diviation(N)
prs = set(pr)
prcnt = collections.Counter(pr)

ans = 0

for a in prs:
  i = 1
  cnt = 2*prcnt[a]
  

  while cnt >= i*(i+1):
    i += 1
  ans += i - 1 
  
print(ans)

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

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

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

    return arr

n=int(input())
if n==1:
    print(0)
    sys.exit()
l=factorization(n)
ans =0
for x in l:
    a=x[0] 
    b=x[1] 
    k=0
    t=0
    while(True):
        t += 1
        k += t
        if k==b:
            ans += t
            break
        elif k > b:
            ans += t-1
            break
print(ans)

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

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

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

    return arr

n=int(input())
ans=0
cnt=[0]
for i in range(1,9):
    for _ in range(i+1):
        cnt.append(i)
lis=factorization(n)


for a,b in lis:
    ans+=cnt[b]
if n==1:
    print(0)
else:print(ans)

Solution (Python):
n = int(input())
n1 = n
pn = []
cnt = 2
ans = 0
while cnt <= int(n ** 0.5):
    while n1 % cnt == 0:
        n1 = n1 // cnt
        pn.append(cnt)
    cnt += 1
pns = list(set(pn))
ansa = []
for i in pns:
    ansa.append(pn.count(i))
for i in ansa:
    x = 1
    while i > 0:
        i -= x
        if i < 0:
            break
        x += 1
        ans += 1
print(ans + 1 if n1 != 1 else 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

ans = 0

soinsu_list = factorization(N)

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

Solution (Python):



def main():
    from collections import deque

    def prime_factorization_list(n: int):
        """
        入力された整数nを素因数分解し，素因数が列挙されたリストで返却
        Parameters
        ----------
        n : int
            素因数分解したい整数
        Returns
        -------
        prime_factorization_lst : lst
            [素因数]の形で素因数が列挙された素因数分解結果
        """
        fct = []  
        b = 2     
        while b * b <= n:
            while n % b == 0:
                n //= b
                fct.append(b)
            b += 1
        if n > 1:
            fct.append(n)
        return fct

    N = int(input())

    q = deque(prime_factorization_list(N))
    memo = []
    while q:
        p = q.popleft()
        res = p
        while res in memo and q:
            can = q.popleft()
            if can == p:
                res *= can
            else:
                res = can
                break
        if res not in memo:
            memo.append(res)
    print(len(memo))


if __name__ == '__main__':
    main()

Solution (Python):
from collections import Counter

N = int(input())

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

count = dict(Counter(prime_factorize(N)))

ans = 0
for c in count.values():
    k = 1
    while c >= k:
        ans += 1
        c -= k
        k += 1

print(ans)

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

from collections import Counter

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

ans = 0

v = list(c.values())
l = len(v)
for i in range(l):
    for j in range(40):
        if j*(j+1)//2 <= v[i] and v[i] < (j+1)*(j+2)//2:
            ans = ans + j

print(ans)

Solution (Python):
import math
def factorization(N):
  tmp=N
  F=[]
  for i in range(2,int(math.sqrt(N))+1):
    if tmp%i==0:
      F.append(i)
      tmp//=i
    while tmp%i==0:
      tmp//=i
    if i>tmp:
      break
  if tmp!=1:
    F.append(tmp)
  return F

N=int(input())
F=factorization(N)
ans=0
for f in F:
  ff=f
  while N%ff==0:
    ans+=1
    N//=ff
    ff*=f
print(ans)

Solution (Python):
import math
def factorization(N):
  tmp=N
  F=[]
  for i in range(2,int(math.sqrt(N))+1):
    if tmp%i==0:
      F.append(i)
      tmp//=i
    while tmp%i==0:
      tmp//=i
    if i>tmp:
      break
  if tmp!=1:
    F.append(tmp)
  return F

N=int(input())
F=factorization(N)
ans=0
for f in F:
  ff=f
  while N%ff==0:
    ans+=1
    N//=ff
    ff*=f
  while N%f==0:
    N//=f
print(ans)

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


def sb(n):
    if n == 1:
        return {1: 0}
    else:
        dic = {}
        tmp = n
        for i in range(2, int(n ** 0.5) + 1):
            if tmp % i == 0:
                dic[i] = 0
                while tmp % i == 0:
                    dic[i] += 1
                    tmp //= i

        if tmp != 1:
            dic[tmp] = 1

        if dic == {}:
            dic[n] = 1

        return dic


ans = 0

for key in sb(N):
    v = sb(N)[key]
    dv = 1
    while v - dv >= 0:
        v -= dv
        dv += 1
        ans += 1

print(ans)

Solution (Python):
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([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr
def main():
  N = int(input())
  l = fac(N)
  counter = 0
  if N == 1:
    print(0)
    exit()
  if len(l) == 1 and l[0][1] == 1:
    print(1)
    exit()
  for x in l:

    temp = 0
    for k in range(1, 141423):
      temp += 1
      z = x[0] ** temp

      if N/z < 1:
        break

      N = N/z
      if float(N).is_integer() == False:
        N = N * z
        break

      counter += 1
    if N <= 1:
      break
  print(counter)
if __name__ == "__main__":
  main()

Solution (Python):
from collections import Counter

N=int(input())

if N==1:
  print(0)
  exit()
  
def factorize(n):
    out=[]
    i = 2
    while 1:
        if n%i==0:
            out.append(i)
            n //= i
        else:
            i += 1
        if n == 1:break
        if i > int(n**.5+3):
            out.append(n)
            break
    
    return out
  
c = Counter(factorize(N))

def n_unique(n):
  out = 0
  while 1:
    if out*(out+1)//2 > n:
      return out-1
    out += 1

ans = 0
for k in c.keys():
  ans += n_unique(c[k])
  
print(ans)

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

N=int(input())
L=factorization(N)
if N==1:
    print(0)
    exit()
ans=0
for l in L:
    ct=0
    fac=1
    while fac<=l[1]:
        ct+=1
        fac+=ct+1
    ans+=ct
print(ans)

Solution (Python):
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

n=k()
ans=0
for i in range(2,1000010):
	power=0
	j=1
	if(n%i==0):
		while(n%i==0):
			power+=1
			n=(n//i)
		while(power>=j):
			power-=j
			j+=1
			ans+=1
if(n>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


n = int(input())
cnt = 0
lis = list(set(prime_factorize(n)))
for i in range(len(lis)):
    for j in range(1, 10**9):
        if n % lis[i]**j == 0:
            n /= lis[i]**j
            cnt+=1
        else:
            break
print(cnt)

Solution (Python):
n = int(input())
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors
p = make_divisors(n)
x = 0
i = 1
ans = 0
def countf(x):
    for j in range(1,x+2):
        if (1+j)*j//2 > x:
            return j - 1
while n != 1:
    if n % p[i] == 0:
        x += 1
        n = n // p[i]
    else:
        if x != 0:
            ans += countf(x)
            x = 0
        i += 1
ans += countf(x)
print(ans)

Solution (Python):
from functools import lru_cache
N = int(input())

@lru_cache(maxsize=None)
def isprime(x):
    i = 2
    while i * i <= x:
        if x % i == 0:
            return False
        i += 1
    return True

@lru_cache(maxsize=None)
def ispow(a, b):
    while a % b == 0:
        a //= b
    return a == 1

prime_cache = [2, 3]

def primeiter():
    global prime_cache
    for p in prime_cache:
        yield p
    x = prime_cache[-1] + 1
    while True:
        if isprime(x):
            prime_cache.append(x)
            yield x
        x += 1

done = set()
while N > 1:
    ds = [N]
    d = 2
    while d * d <= N:
        if N % d == 0:
            if not d in done:
                ds.append(d)
            d2 = N // d
            if d2 != d and not d2 in done:
                ds.append(d2)
        d += 1
    ds.sort()
    z = -1
    for d in ds:
        if isprime(d):
            z = d
            break
        for p in primeiter():
            if d < p:
                break
            if ispow(d, p):
                z = d
                break
        if z > 0:
            break
    if z < 0:
        break
    N //= z
    done.add(z)
print(len(done))

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

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

def factorization(n):
    if (n == 1):
        return []

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

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

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

    return arr



list_a = factorization(N)
count = 0
for i in range(len(list_a)):
    num = list_a[i][1]
    cal = 1
    while(num > 0):
        
        num -= cal
        cal += 1
        if(num < 0) :
            break
        
        count += 1

        

print(count)

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

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

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

    return arr

N = int(input())

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

    X = factorization(N)

    ans = 0
    for x,y in X:
        ans += int((-1+(1+8*y)**(1/2))/2)

    print(ans)

Solution (Python):
from collections import Counter
import sys
import math
N = int(input())
M = N
Nso = []
Nruto = math.sqrt(N)
Nruto = math.ceil(Nruto)
for i in range(2, Nruto+1):
    while N % i == 0:
        N = N//i
        Nso.append(i)
    if N == 1:
        break
    Nruto = math.sqrt(N)
    Nruto = math.floor(Nruto)

Nso.append(N)
if 1 in Nso:
    Nso.remove(1)

if len(Nso) == 0:
    if M == 1:
        print(0)
    else:
        print(1)
    sys.exit()

ans = 0
Nso = Counter(Nso)

for i in Nso.values():
    x = math.sqrt(2*i)
    x = math.floor(x)
    for j in range(x, 0, -1):
        if j*j+j <= 2*i:
            ans += j
            break
print(ans)

Solution (Python):
from collections import Counter

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


ans = 0
for c in cnt.values():
    tmp = 1
    while c >= tmp:
        c -= tmp
        ans += 1
        tmp += 1
        
print(ans)

Solution (Python):
P = [1 for _ in range(10**6)]
P[0]=0
P[1]=0
for i in range(2,10**3):
    for j in range(i*i,10**6,i):
        P[j] = 0
Q = []
for i in range(10**6):
    if P[i]==1:
        Q.append(i)
N = int(input())
C = {}
for q in Q:
    if N%q==0:
        cnt = 0
        while N%q==0:
            N = N//q
            cnt += 1
        C[q] = cnt
if N>1:
    C[N] = 1
cnt = 0
for q in C:
    n = C[q]
    k = 1
    while n>=(k*(k+1))//2:
        k += 1
    cnt += k-1
print(cnt)

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


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

ans = 0
for _, f in pf:
    x = 1
    while f >= x:
        ans += 1
        f -= x
        x += 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

def count(X):
  cnt = 0
  now = 1
  while cnt+now <=X:
    cnt += now
    now += 1
  return now-1


N = int(input())
if N == 1:
  print(0)
  exit()
A = factorization(N)

ans = 0
for i in range(len(A)):
  ans += count(A[i][1])
print(ans)

Solution (Python):
import itertools

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







t=int(input())
if t==1:
  print(0)
  exit()
  
ans=0
x=factorization(t)


z=[i for i in range(51)]
z=list(itertools.accumulate(z))

for i in range(len(x)):
    cnt=x[i][1]
    for j in range(len(z)):
        if z[j]>cnt:
            ans+=j-1
            break

print(ans)

Solution (Python):
N = int(input())
dp = [True] * 10**6
count = 0
if N % 2 == 0:
    times = 0
    while(N % 2 == 0):
        times += 1
        N //= 2
    i = 1
    while(times-i >= 0):
        times -= i
        i += 1
        count += 1
f = 3
while f**2 < N:
    if N % f == 0:
        times = 0
        while(N % f == 0):
            times += 1
            N //= f
        i = 1
        while(times-i >= 0):
            times -= i
            i += 1
            count += 1
    else:
        f += 2
if N != 1:
    count += 1
print(count)

Solution (Python):


import bisect

line=[i*(i+1)//2 for i in range(10**6+1)]

N=int(input())


do=[0 for i in range(10**6+1)]

for i in range(2,int(N**0.5)+1):
    while N%i==0:
        N/=i
        do[i]+=1

ans=0 if N==1 else 1

for _,item in enumerate(do):
    index=(bisect.bisect_right(line,item))-1
    ans+=index

print(ans)

Solution (Python):
from math import sqrt


N = int(input())
ans = 0
for d in range(2, int(sqrt(N)) + 1):
    if N % d == 0:
        i = 1
        while N % d**i == 0:
            ans += 1
            N //= d**i
            i += 1
        while N % d == 0:
            N //= d

if N > 1:
    ans += 1
print(ans)

Solution (Python):
from math import sqrt


def eratosthenes(x):
    prime = []
    for i in range(2, int(sqrt(x)) + 1):
        if x % i == 0:
            prime.append(i)
            while x % i == 0:
                x //= i
    
    return prime


N = int(input())
prime = eratosthenes(N)
ans = 0
for x in prime:
    i = 1
    while N % x**i == 0:
        ans += 1
        N //= x**i
        i += 1
    while N % x == 0:
        N //= x

if N > 1:
    ans += 1
print(ans)

Solution (Python):
def main():
    n = int(input())
    ans = 0
    for k in range(2,int(n**0.5)+1):
        if n%k==0:
            cnt,mx = 0,0
            while n%k==0:
                n = n//k
                cnt += 1
                if cnt > mx:
                    ans += 1
                    mx += 1
                    cnt = 0
    if n!=1:
        ans += 1
    print(ans)

if __name__ == "__main__":
    main()

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

def factorize(n):
    result = []
    tmp = n

    for i in range(2, int(n**0.5)+1):
        if tmp % i == 0:
            cnt = 0
            while tmp % i == 0:
                cnt += 1
                tmp //= i
            result.append(cnt)
         
    if tmp != 1:
        result.append(1)
    
    if len(result) == 0:
        result.append(1)
    
    return result

def nearest_sum(n):
    num_list = [1]
    
    if n <= 2:
        return 1

    i = 2
    while True:
        num_list.append(num_list[-1]+i)
        i += 1
        if num_list[-1]+i > n:
            break
    
    return i-1

if N == 1:
    print(0)
else:
    ind_list = factorize(N)

    cnt = 0
    for ind in ind_list:
        cnt += nearest_sum(ind)

    print(cnt)

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

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

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

    return arr

def main():
    n = int(input())
    primes = factorization(n)
    count = 0
    for prime in primes:
        e = prime[1]
        k = 1
        while e >= 0:
            e -= k
            k += 1
            if e >= 0:
                count += 1
    print(count)

if __name__ == '__main__':
    main()

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

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

    return arr

x = factorization(n)
ans = 0
for i in range(len(x)):
  x[i][1] -= 1
  ans += 1
  y = 2
  while x[i][1] > 0:
    x[i][1] -= y
    if x[i][1] >= 0:
      ans += 1
    y += 1
 
print(ans)

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):
import math 
def prime(n):
    d = {}
    if n%2==0:
        d[2]=0
    while n % 2 == 0: 
        d[2]+=1
        n = n / 2
    for i in range(3,int(math.sqrt(n))+1,2):
        if n%i==0:
            d[i]=0
        while n % i== 0: 
            d[i]+=1
            n = n / i 
    if n > 2:
        d[n]=1
    return d
def maxsum(di):
    ans = 0
    for i in di.items():
        c = 1
        x = 0
        y = i[1]
        while y-c>=0:
            
            y-=c
            c+=1
            x+=1
        ans+=x
    return ans
di = prime(int(input()))

print(maxsum(di))

Solution (Python):

def prime_factorization(n):
    """do prime factorization using trial division

    Returns:
        [[prime1,numbers1],[prime2,numbers2],...]
    """
    res = []
    for i in range(2,int(n**0.5)+1):
        if n%i==0:
            cnt=0
            while n%i==0:
                cnt+=1
                n//=i
            res.append([i,cnt])
    if n!=1:
        res.append([n,1])
    return res

def main():
    import sys
    input = sys.stdin.readline

    N = int(input())
    prime_factors = prime_factorization(N)
    ans = 0
    for p in prime_factors:
        i = 1
        while i <= p[1]:
            ans += 1
            N /= p[0]**i
            p[1] -= i
            i += 1
    print(ans)

if __name__ == '__main__':
    main()