Problem:
 Score : 400 points    Problem Statement  Given is a positive integer N . Consider repeatedly applying the operation below on N :   First, choose a positive integer z satisfying all of the conditions below:  z can be represented as z=p^e , where p is a prime number and e is a positive integer;  z divides N ;  z is different from all integers chosen in previous operations.    Then, replace N with N/z .   Find the maximum number of times the operation can be applied.      Constraints   All values in input are integers.  1 \leq N \leq 10^{12}         Input  Input is given from Standard Input in the following format:  N       Output  Print the maximum number of times the operation can be applied.        Sample Input 1 24      Sample Output 1 3  We can apply the operation three times by, for example, making the following choices:   Choose z=2 (=2^1) . (Now we have N=12 .)  Choose z=3 (=3^1) . (Now we have N=4 .)  Choose z=4 (=2^2) . (Now we have N=1 .)        Sample Input 2 1      Sample Output 2 0  We cannot apply the operation at all.       Sample Input 3 64      Sample Output 3 3  We can apply the operation three times by, for example, making the following choices:   Choose z=2 (=2^1) . (Now we have N=32 .)  Choose z=4 (=2^2) . (Now we have N=8 .)  Choose z=8 (=2^3) . (Now we have N=1 .)        Sample Input 4 1000000007      Sample Output 4 1  We can apply the operation once by, for example, making the following choice:   z=1000000007 (=1000000007^1) . (Now we have N=1 .)        Sample Input 5 997764507000      Sample Output 5 7

Solution (Python):
from collections import Counter
import sys

def prime_factorize(n):
    ans = []
    while not n%2:
        ans.append(2)
        n //= 2
    mod = 3
    while mod**2 <= n:
        if n%mod == 0:
            ans.append(mod)
            n //= mod
        else:
            mod += 2
    if n != 1:
        ans.append(n)
    counter = Counter(ans)
    return counter


def main():
    input = sys.stdin.readline
    n = int(input())
    primes = prime_factorize(n)
    ans = 0
    for v in primes.values():
        value = v
        if value <= 2:
            ans += 1
            continue
        ans += 1
        value -= 2
        k = 3
        while value > 0:
            value -= k
            k += 1
            ans += 1
            
          
    print(ans)
    
    
if __name__ == "__main__":
    main()

Solution (Python):
import sys
import math
from collections import deque
from collections import defaultdict

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

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

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

    return arr

def main():
    n = int(sys.stdin.readline())
    base = factorization(n)
    ans = 0
    for x in list(base.keys()):
        i = 1
        while(base[x] >= i):
            base[x] -= i
            ans += 1
            i += 1
    print(ans)
    return 0

if __name__ == "__main__":
    main()

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
nprime=factorization(N)
ans=0
for t in nprime:
    now=1
    count=0
    while t[1]>=now:
        t[1]-=now
        now+=1
        count+=1
    ans+=count
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())
fact=factorization(N)
if fact[0][0]==1:
    fact=fact[1:]
ans=0
for i in range(len(fact)):
    n= 1
    while n*(n+1)//2<=fact[i][1]:
        n+=1
    ans+=n-1

print(ans)

Solution (Python):
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  
def LS2(): return list(sys.stdin.readline().rstrip())  

N = I()

import math

d = {}
for i in range(2,math.floor(math.sqrt(N))+1):
    if N % i == 0:
        r = 0
        while N % i == 0:
            N //= i
            r += 1
        d[i] = r
if N != 1:
    d[N] = 1

ans = 0
for i in d.keys():
    r = d[i]
    b = 1
    a = 0
    while r > 0:
        r -= b
        if r >= 0:
            b += 1
            a += 1
        else:
            break
    ans += a

print(ans)

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

primes = [0]
while N % 2 == 0:
    primes[0] += 1
    N //= 2

if N != 1:
    for i in range(3, 1000000, 2):
        if N % i == 0:
            primes.append(0)
            while N % i == 0:
                primes[-1] += 1
                N //= i
            if N == 1:
                break
    else:
        primes.append(1)

ans = 0
for e in primes:
    i = 0
    while True:
        i += 1
        e -= i
        if e >= 0:
            ans += 1
        else:
            break

print(ans)

Solution (Python):


import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))

def resolve():
    N,=pin()
    if N==1:
        print(0)
        return

        
    n=int(N**0.5)+1
    divs=dict()
    temp=N
    for i in range(2,n+4):
        while (1):
            if temp%i !=0:
                break
            divs.setdefault(i,0)
            divs[i]+=1
            temp/=i
    if temp>1:
        divs.setdefault(temp,1)
    
    check=1
    ans=0
    for p,q in divs.items():
        check*=p**q
        temp2=0
        for i in range(1,50):
            temp2+=i
            if temp2>q:
                break
            ans+=1
            
            
        
    print(ans)
    assert N== check
    

resolve()

Solution (Python):
import collections

def Z(): return int(input())
def ZZ(): return [int(_) for _ in input().split()]

def main():
    N = Z()

    def bunkai(num):
        i = 2
        ret = []
        a = num
        while i*i <= num:
            c = 0
            while a%i == 0:
                a //= i
                c += 1
            if c > 0: ret.append([i, c])
            i += 1
        if a != 1: ret.append([a, 1])
        return ret

    pl = bunkai(N)
    output = 0
    for i in range(len(pl)):
        _, c = pl[i]
        j = 1
        while c >= j:
            c -= j
            j += 1
            output += 1
    print(output)

    return

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())
a = factorization(n)
c = 0
if n == 1:
  print(0)
  exit()
for d in a:
  s = d[1]
  if s > 44:
    c += 9
  elif s > 35:
    c += 8
  elif s > 27:
    c += 7
  elif s > 20:
    c += 6
  elif s > 14:
    c += 5
  elif s > 9:
    c += 4
  elif s > 5:
    c += 3
  elif s > 2:
    c += 2
  elif s > 0:
    c += 1
print(c)

Solution (Python):
from copy import deepcopy
m = 43
table = [[] for i in range(43)]
table[0].append(set([0]))
table[1].append(set([1]))
for i in range(2,m):
    table[i].append(set([i]))
    for j in range(1, i):
        k = i-j
        for t in table[j]:
            if k in t:
                continue
            tmp = deepcopy(t)
            tmp.add(k)
            table[i].append(tmp)
    l = max(len(a) for a in table[i])
    tmp = []
    for a in table[i]:
        if len(a) == l:
            tmp.append(a)
    table[i] = tmp
table = [max(len(j) for j in i) for i in table]

n = int(input())
def factorization(n):
    ret = {}
    for i in range(2, int(n**0.5)+1):
        while n % i == 0:
            ret[i] = ret.get(i, 0) + 1
            n //= i
    if n != 1:
        ret[n] = ret.get(n, 0) + 1
    return ret

d = factorization(n)
ans = 0
for k,v in d.items():
    ans += table[v]
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

H=[]
for j in range(10):
    H+=[j]*(j+1)

N=int(input())
S=0

if N!=1:
    L=factorization(N)
    S=0
    for (x,a) in L:
        S+=H[a]

print(S)

Solution (Python):
import collections

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


N = int(input())

primes = collections.Counter(prime_factorize(N))

answer = 0

for key in primes:
    number = primes[key]
    minus_number = 1
    while True:
        number -= minus_number
        if number < 0:
            break
        minus_number += 1
    answer += (minus_number - 1)

print(answer)

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
import collections
c = collections.Counter(prime_factorize(n))
ans=0
for x in list(c.values()):
  now=1
  i=1
  while now<x+1:
    now+=(i+1)
    i+=1
  ans+=(i-1)
print(ans)

Solution (Python):
import bisect
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
acc = [0 for i in range(1000)]
acc[1] = 1
for i in range(2,1000):
    acc[i] = acc[i-1] + i
array = factorization(n)
ans = 0
for num, count in array:
    index = bisect.bisect_right(acc, count)
    ans += (index - 1)
print(ans)

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

d = {}
for i in range(2,int(n**0.5)+1):
    if n%i == 0:
        d[i] = 0
        while n%i == 0:
            d[i] += 1
            n //= i
if n > 1:
    d[n] = 1

ans = 0
for i in d.values():
    x = i
    for j in range(1,10000):
        if x >= j:
            x -= j
            ans += 1
        else:
            break
print(ans)

Solution (Python):
import sys
readline=sys.stdin.readline
 
N = int(readline())
if N == 1:
  print(0)
  exit(0)

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

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

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

    return arr
  


arr = factorization(N)
ans = 0
for a in arr:
  facts = a[1]
  i = 1
  while i <= facts:
    ans += 1
    facts -= i
    i += 1
print(ans)

Solution (Python):
from collections import defaultdict
n = int(input())
d = defaultdict(int)
k = 2
while n > 1 and k * k <= n:
    if n % k == 0:
        d[k] += 1
        n //= k
    else:
        k += 1
if n > 1:
    d[n] += 1
ans = 0
for k,v in d.items():
    a = 1
    while v >= a:
        v -= a
        a += 1
        ans += 1
print(ans)

Solution (Python):
from math import sqrt
  
def primeFactors(n): 
    factor = dict()
    
    while n % 2 == 0: 
        if 2 not in factor:
            factor[2] = 1
        else:
            factor[2] += 1
        n = n / 2
          
    
    
    for i in range(3,int(sqrt(n))+1,2): 
        
        while n % i== 0: 
            if i not in factor:
                factor[i] = 1
            else:
                factor[i] += 1
            n = n / i 
              
    if n > 2: 
        factor[n] = 1

    return factor

x = int(input())
res = 0
pf = primeFactors(x)
for i in pf:
    res += int(0.5*(sqrt(8*pf[i] + 1) - 1))

print(res)

Solution (Python):
import collections

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

def main():
    N = int(input())
    P = prime_factorize(N)
    C = collections.Counter(P)
    

    ans = 0
    for k, v in C.items():
        x = 1
        while v - x >= 0:
            v -= x
            x += 1
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):






def swaparr(arr, a,b):
    temp = arr[a];
    arr[a] = arr[b];
    arr[b] = temp


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


def nCr(n, k): 
    if(k > n - k): 
        k = n - k 
    res = 1
    for i in range(k): 
        res = res * (n - i) 
        res = res / (i + 1) 
    return int(res) 


def upper_bound(a, x, lo=0):
    hi = len(a)
    while lo < hi:
        mid = (lo+hi)//2
        if a[mid] < x:
            lo = mid+1
        else:
            hi = mid
    return lo


def primefs(n):
    
    primes = {}
    while(n%2 == 0):
        primes[2] = primes.get(2, 0) + 1
        n = n//2
    for i in range(3, int(n**0.5)+2, 2):
        while(n%i == 0):
            primes[i] = primes.get(i, 0) + 1
            n = n//i
    if n > 2:
        primes[n] = primes.get(n, 0) + 1
    
    
    return primes


def power(x, y, p): 
    res = 1
    x = x % p  
    if (x == 0) : 
        return 0
    while (y > 0) : 
        if ((y & 1) == 1) : 
            res = (res * x) % p 
        y = y >> 1      
        x = (x * x) % p 
    return res 


def swap(a,b):
    temp = a
    a = b
    b = temp
    return a,b









def find(x, link):
    p = x;
    while( p != link[p]):
        p = link[p];
    
    while( x != p):
        nex = link[x];
        link[x] = p;
        x = nex;
    return p;




def union(x, y, link, size):
    x = find(x, link)
    y = find(y, link)
    if size[x] < size[y]:
        x,y = swap(x,y)
    if x != y:
        size[x] += size[y]
        link[y] = x


def sieve(n): 
    prime = [True for i in range(n+1)] 
    p = 2
    while (p * p <= n): 
        if (prime[p] == True): 
            for i in range(p * p, n+1, p):
                prime[i] = False
        p += 1
    return prime


MAXN = int(1e6 + 5)
def spf_sieve():
    spf[1] = 1;
    for i in range(2, MAXN):
        spf[i] = i;
    for i in range(4, MAXN, 2):
        spf[i] = 2;
    for i in range(3, ceil(MAXN ** 0.5), 2):
        if spf[i] == i:
            for j in range(i*i, MAXN, i):
                if spf[j] == j:
                    spf[j] = i;
    




def factoriazation(x):
    ret = {};
    while x != 1:
        ret[spf[x]] = ret.get(spf[x], 0) + 1;
        x = x//spf[x]
    return ret
    
    


def int_array():
    return list(map(int, input().strip().split()))

def str_array():
    return input().strip().split();


MOD = int(1e9)+7;
CMOD = 998244353;
INF = float('inf'); NINF = -float('inf');



n = int(input()); prs = primefs(n);
ans = 0;
for i in prs:
    k = prs[i];
    ts = (-1 + (1 + 8*k)**0.5)//2;
    ans += ts;
print(int(ans));

Solution (Python):
import math
def findFactors(n):
    now=n
    f=[]
    while now%2==0:
        now//=2
        f.append(2)
    p=3
    while p<=math.sqrt(n):
        while now%p==0:
            now//=p
            f.append(p)
        p+=2
        if now==1:
            break
    if now>math.sqrt(n):
        f.append(now)
    return f

C=[0]
for i in range(1,100):
    C.append(C[-1]+i)
    
n=int(input())
F=findFactors(n)

ans=0
now=0
cnt=0
for f in F:
    if now!=f:
        for c in range(1,90):
            if C[c]>cnt:
                break
        ans+=c-1
        now=f
        cnt=1
    else:
        cnt+=1
for c in range(1,100):
    if C[c]>cnt:
        break
ans+=c-1       
print(ans)

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

jud = [1]
for i in range(10**6):
  jud.append(jud[-1]+i+2)

ans = 0
for k in fac:
  num = fac[k]
  for i in range(10**6):
    if num >= jud[i]:
      ans += 1
    else:
      break
print(ans)

Solution (Python):
from sys import stdin, setrecursionlimit
input = stdin.buffer.readline
setrecursionlimit(10 ** 7)

from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
from collections import deque, defaultdict, Counter
from itertools import combinations, permutations, combinations_with_replacement
from itertools import accumulate
from math import ceil, sqrt, pi, radians, sin, cos

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 g(n):
    ret = 0
    for i in range(1, 100):
        n -= i
        if n < 0:
            break
        ret += 1
    return ret

MOD = 10 ** 9 + 7
INF = 10 ** 18

N = int(input())

if N == 1:
    print(0)
else:
    f = factorization(N)
    f.sort(key = lambda x: -x[1])
    len_f = len(f)

    answer = 0
    for i in range(len_f):
        answer += g(f[i][1])
    print(answer)

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])
    return arr
l=factorization(n)
ans=0
for p,i in l:
  cnt=1
  while i>=cnt:
    ans+=1
    i-=cnt
    cnt+=1
print(ans)

Solution (Python):
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n = int(input())
data = [0] * (10**5)
for i in range(1,10**5):
  data[i] = data[i-1] + i

def prime_factor(n):
    ass = []
    for i in range(2,int(n**0.5)+1):
        count=0
        while n % i==0:
            count+=1
            n = n//i
        if count!=0:
            ass.append((i,count))
    if n != 1:
        ass.append((n,1))
    return ass
ass = prime_factor(n)
for num,count in ass:
  ans += bisect.bisect_right(data,count)-1
  
print(ans)

Solution (Python):
import sys; input = sys.stdin.buffer.readline
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

def getlist():
	return list(map(int, input().split()))


num = 10 ** 6 + 1 
L = [1 for i in range(num)]; L[0] = 0; L[1] = 0
plist = []
for i in range(num):
	if L[i] == 1:
		plist.append(i); c = 2
		while i * c <= num - 1:
			L[i * c] = 0; c += 1

def prime_factorization(N):
	D = defaultdict(int)
	for i in plist:
		while N % i == 0:
			D[i] += 1; N = int(N // i)

	if N != 1:
		D[N] += 1

	return D



def main():
	N = int(input())
	fac = prime_factorization(N)
	ans = 0
	
	for i in fac:
		for j in range(1, 100):
			if fac[i] < int((j * (j + 1) // 2)):
				ans += j - 1
				break

	print(ans)

if __name__ == '__main__':
	main()

Solution (Python):
def prime_factorize(n):
    dic = {}
    while n % 2 == 0:
        if 2 in dic:
            dic[2] += 1
        else:
            dic[2] = 1
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            if f in dic:
                dic[f] += 1
            else:
                dic[f] = 1
            n //= f
        else:
            f += 2
    if n != 1:
        if n in dic:
            dic[n] += 1
        else:
            dic[n] = 1
    return dic

n = int(input())
dic = prime_factorize(n)
ans = 0
for value in dic.values():
    left = 1 
    right = value 
    while left + 1 < right:
        mid = (left+right)//2
        if mid * (mid+1) / 2 <= value:
            left = mid
        else:
            right = mid
    ans += left

print(ans)

Solution (Python):
n = int(input())
if n == 1:
    print(0)
    exit()
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
b = []
d = prime_factorize(n)
c = len(d)
count = 1
for i in range(1,c):
    if d[i] != d[i-1]:
        b.append(count)
        count = 1
    else:
        count+=1
b.append(count)
ans = 0
for i in b:
    j = 1
    count2 = 0
    while count2 <= i:
        count2 += j
        j += 1
    ans += (j - 2)
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



count = 0

for i in factorization(N):

    
    if i[0] != 1:
        minus = 1
        while i[1] > 0:
            i[1] -= minus
            if i[1] < 0:
                break
            minus += 1
            count += 1
    
print(count)

Solution (Python):
from sys import stdin
N = int(stdin.readline().rstrip())

def factorize(n):
    fct = []  
    b, e = 2, 0  
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct

if N == 1:
    print(0)
else:
    ans = 0
    for i,j in factorize(N):
        for k in range(1,10**9):
            j -= k
            if j < 0:
                break
            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
p = [1, 3, 6, 10, 15, 21, 28, 36]
n = int(input())
sss  = factorization(n)
ans = 0
if(n == 1):
    print(0)
else:
    for i in sss:
        s = 7
        while(i[1] < p[s]):
            s -= 1
        ans += s+1
    print(ans)

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    from collections import defaultdict
    N = int(input())
    ans = defaultdict(int)
    while N % 2 == 0:
        ans[2] += 1
        N //= 2
    f = 3
    while f * f <= N:
        if N % f == 0:
            ans[f] += 1
            N //= f
        else:
            f += 2
    if N != 1:
        ans[N] += 1
    
    Ans = 0
    for v in ans.values():
        x = 1
        while x * (x+1) // 2 <= v:
            x += 1
        Ans += x-1
    print(Ans)

if __name__ == '__main__':
    main()

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def factorization(n):
    factors = []

    if n < 2:
        return n

    while n % 2 == 0:
        factors.append(2)
        n //= 2

    for i in range(3, int(n ** 0.5) + 5, 2):
        while n % i == 0:
            factors.append(i)
            n //= i

    if n != 1:
        factors.append(n)

    return factors


def main():
    from collections import Counter

    n = int(input())

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

    factors = Counter(factorization(n))

    ans = 0
    i = 0
    flag = True

    while flag:
        flag = False
        i += 1
        for key in factors.keys():
            if factors[key] >= i:
                ans += 1
                factors[key] -= i
                flag = True

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
from collections import Counter

def primeFactors(n):
    res = []
    while n%2==0:
        res.append(2)
        n //= 2
    x = 3
    while n>1 and n>=x*x:
        while n%x==0:
            res.append(x)
            n //= x
        x += 2
    if n>1:
        res.append(n)
    return res

n = int(input())
pl = primeFactors(n)

res = 0
cd = Counter(pl)
for k in cd:
    c = cd[k]
    i = 1
    while c-i>=0:
        c -= i
        res += 1
        i += 1
print(res)

Solution (Python):
n=int(input())
from math import sqrt as S 
pf=[]
for i in range(2,int(S(n))+1):
    if n%i==0:
        c=0 
        while n%i==0:
            n//=i 
            c+=1 
        pf.append([i,c])
if n>1:
    pf.append([n,1])
cnt=0 
def search(x):
    lo=0
    hi=10**9 
    ans=0 
    while lo<=hi:
        mi=(lo+hi)//2 
        if mi*(mi+1)//2<=x:
            ans=mi 
            lo=mi+1 
        else:
            hi=mi-1 
    return ans 
for x in range(len(pf)):
    a=pf[x][0]
    b=pf[x][1]
    cnt+=search(b)
print(cnt)

Solution (Python):
n=int(input()) 
s=[]
for i in range(2,int(n**0.5)+1):
    if n%i==0:
        p=0
        while(n%i==0):
            p+=1
            n//=i
        s.append(p)
if n>1:
    s.append(1)

ans=0
for i in s:
    r=1
    while(i>0):
        if i<r:
            break
        i-=r 
        r+=1
        ans+=1 
print(ans)

Solution (Python):
import sys
def main():
    input = sys.stdin.readline
    N = int(input())
    ans = 0
    for i in range(2, int(N ** 0.5) + 1):
        c = 0
        while N % i == 0:
            c += 1
            N //= i
        i = 0
        while c > i:
            ans += 1
            i += 1
            c -= i
    if N > 1:
        ans += 1
    print(ans)

if __name__ == '__main__':
    main()

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

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

fac = factorization(N)
ans = 0

for k, v in fac:
    cnt = 1
    if k != 1:
        while True:
            v -= cnt
            if v < 0:
                break
            ans += 1
            cnt += 1

print(ans)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(input())


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


f = fctr1(N)

ans = 0
for n, v in f:
    c = 1
    while 0 < v:
        v -= c
        c += 1

        if v >= 0:
            ans += 1

print(ans)

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
from collections import deque,defaultdict
import heapq
from itertools import combinations
import bisect


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

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

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

    return arr

n=int(input())
if n==1:
    print(0)
    exit()
p=fact(n)
ans=0
for a,b in p:
    t=1
    g=b
    while g>=t:
        g-=t
        t+=1
    ans+=t-1
print(ans)

Solution (Python):
import bisect
import heapq
import math
import random
import sys
import collections
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub, or_

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1

def read_int():
    return int(input())

def read_int_n():
    return list(map(int, input().split()))

def read_float():
    return float(input())

def read_float_n():
    return list(map(float, input().split()))

def read_str():
    return input().strip()

def read_str_n():
    return list(map(str, input().split()))

def error_print(*args):
    print(*args, file=sys.stderr)

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 main():
    n = read_int()
    f = factorization(n)
    count = 0
    for x in f:
        if x[0] == 1:
            continue
        lc = x[1]
        for i in range(1,INF):
            if i <= lc:
                lc = lc - i
                count+=1
            else:
                break
    print(count)

if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
total = 0
for i in range(2, int(n**(1/2)+2)):
    acc = 0
    while n % i == 0:
        acc += 1
        n //= i
    total += (-1 + (1 + 8 * acc)**(1/2)) // 2;
if n != 1:
    total += 1
print(int(total))

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

prime = factorization(N)
count = 0
for i in range(len(prime)):
    num, e = prime[i]
    tmp = 1
    while True:
        e -= tmp
        if e >= 0:
            count += 1
        else:
            break
        tmp += 1
        
print(count)