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):
def cultimes(x):
  base=0
  start=0
  if x==0:
    return 0
  if x==1:
    return 1
  while  start <x+1:
    base+=1
    start=(base+1)*(base+2)//2
  return base
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())
m=factorization(n)
t=0
for x in m:
  t+=cultimes(x[1])
t=int(t)
if n==1:
  t=0
print(t)

Solution (Python):
import math
from collections import defaultdict

def isPrime(num):
    prime = True
    save = num
    save2 = None
    for i in range(2, int(math.sqrt(num))+1):
        if num % i == 0:
            prime = False
            save = i
            save2 = num // i
            break
    return prime, save, save2

store = defaultdict(int)

def solve(num):
    check, num1, num2 = isPrime(num)
    if check == True:
        global store
        store[num1] += 1
    if check == False:
        solve(num1)
        solve(num2)

n = int(input())
if n <= 1:
    print(0)
else:
    count = 0
    solve(n)
    for key, v in store.items():
        for i in range(1, v+1):
            if store[key] >= i:
                store[key] -= i
                count += 1
            else:
                break
    print(count)

Solution (Python):

c = 0
m = int(input())
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
for i in pf:
    for j in range(pf[i]):
        pf[i] -= j + 1
        c += 1
        if pf[i] < 0:
            c -= 1
            break
        elif pf[i] == 0:
            break
print(c)

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

cnt = Counter(prime_factorize(n))
z = []
for k, v in cnt.items():
    for i in range(1, v+1):
        z.append(k**i)
z = list(set(z))
z.sort()

ans = 0
for pe in z:
    if n%pe == 0:
        n /= pe
        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())
prime_factors = factorization(n)


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

counter = 0
for factor in prime_factors:
  factor_num = factor[1]
  power = 1
  while factor_num - power >= 0:
    factor_num -= power
    counter += 1
    power += 1

print(counter)

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

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

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

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

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

    return arr

def count(m):
    count = 0
    for i in range(1, 10**12+1):
        if m >= i :
            m -= i
            count += 1
        else:
            return count


bun = factorization(n)

kazu = len(bun)






countup = 0
for i in range(kazu):
    countup += count(bun[i][1])

print(countup)

Solution (Python):
import math
data = input()
target = int(data)

def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        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]]

list = primes(2000000)
result =[]
for i in list:
    check = target
    k = 0
    while True:
        if check % i != 0:
            break
        else:
            check = check/i
            k +=1
    result.append(k)

ans = 0
for j in result:
    y = 0
    z = j
    while z > y:
        y += 1
        z -= y
        ans += 1


cover = 1
for i in range(len(list)):
    cover = cover*(list[i]**result[i])
if target/cover >2000000:
    ans +=1
print(ans)

Solution (Python):
import collections
import numpy as np

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))
X = np.array([])
for i in c.values():
    X = np.append(X,i)

ans = 0

for i in range(1,10**6):
    if len(X) == 0:
        print(ans)
        exit()
    X -= i
    X = X[X>=0]
    ans += len(X)

Solution (Python):
import math
import numpy as np

def myfunc(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

N = int(input())
M = (math.sqrt(N)) + 1

L = np.array([1, 3, 6, 10, 15, 21, 28, 36])

f = myfunc(N)
count = 0
for _, c in f:
    if c == 1:
        count += c
    else:
        i = (L <= c).sum()
        count += i

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

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



    return arr

N=int(input())
count_list=factorization(N)
ans=0
for k in range(0,len(count_list)):
    dlt=1
    c=count_list[k]
    while (c-dlt)>=0:
        c=c-dlt
        dlt+=1
        ans+=1
print(ans)

Solution (Python):
N = int(input())
S = 0
Tri = [0,1,3,6,10,15,21,28,36,45,55,66,78,91]
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

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

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

    return arr
A = factorization(N)

if N > 1:
    for i in range (len(A)):
        T = A[i][1]
        j = 0
        while(T>=Tri[j]):
            j += 1
        S += (j-1)
                

print(S)

Solution (Python):


"""
    Author : thekushalghosh
    Team   : CodeDiggers
 
    I prefer Python language over the C++ language :p :D
        
    Visit my website : thekushalghosh.github.io
"""
import sys,math,cmath,time,decimal
start_time = time.time()



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

def solve():
    n = inp()
    if n == 1:
        print(0)
        return
    a = qw(n)
    c = 0
    q = a[0]
    w = 0
    qq = 0
    for i in range(len(a)):
        if a[i] == q:
            c = c + 1
            if c > w:
                qq = qq + 1
                w = c
                c = 0
        else:
            qq = qq + 1
            c = 0
            w = 1
            q = a[i]
    print(qq)
                


 
def main():
    global tt
    if not ONLINE_JUDGE:
        sys.stdin = open("input.txt","r")
        sys.stdout = open("output.txt","w")
    t = 1
    for tt in range(t):
        solve()
    if not ONLINE_JUDGE:
        print("Time Elapsed :",time.time() - start_time,"seconds")
    sys.stdout.close()
    

def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    return(input().strip())
def invr():
    return(map(float,input().split()))
 

def counter(a):
    q = [0] * max(a)
    for i in range(len(a)):
        q[a[i] - 1] = q[a[i] - 1] + 1
    return(q)
 
def string_counter(a):
    q = [0] * 26
    for i in range(len(a)):
        q[ord(a[i]) - 97] = q[ord(a[i]) - 97] + 1
    return(q)
 
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
    input = sys.stdin.readline
   
  
  
main()

Solution (Python):
import collections
import math

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

a = collections.Counter(prime_factorize(n))

res = 0

for i in a.items():
    if i[1] > 3:
        x = 2
        y = 3
        while True:
            x += 1
            y = y + x
            if y > i[1]:
                res += x - 1
                break
    elif i[1] == 3:
        res += 2
    else:
        res += 1

print(res)

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

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

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

def step(n):
    s = 1
    ret = 0
    while n >= s:
        n -= s
        s += 1
        ret += 1
    return ret
if N == 1:
    print(0)
    exit()

factor = factorization(N)
ret = 0
for f, g in factor:
    ret += step(g)
print(ret)

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())
x = factorization(n)
x.sort(key=lambda x: x[-1])
a = [0]
b = 3
for i in range(3,30):
    a.append(b)
    b += i
ans = 0
c = 1
for i in range(len(x)):
    for j in range(len(a)):
        if x[i][1] >= a[c]:
            c += 1
        else:
            break
    ans += c
if n == 1:
    print(0)
else:
    print(ans)

Solution (Python):
import collections
import numpy as np
num =  int(input())
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
c = collections.Counter(prime_factorize(num))
ln = np.array(list(c.values()) )

minus = 1
number = 0

if len(ln) == 0:
    ln = [-1]
    
while max(ln) >= 0:
    ln = ln - minus
    
    for i in range(len(ln)):
        if ln[i] >= 0:
            number += 1
    
    minus += 1
print(number)

Solution (Python):
import numpy as np

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())
    
    primes = prime_factorize(N)
    u, counts = np.unique(primes, return_counts=True)
    
    ans = 0
    for c in counts:
        i = 1
        while c - i >= 0:
            c -= i
            i += 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


fcl = factorization(N)

result = 0
count = len(fcl)

for i in range(count):
    num = 1
    while fcl[i][1] >= num:
        fcl[i][1] = fcl[i][1] - num
        num += 1
        if fcl[i][0] > 1:
            result += 1
print(result)

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
c = collections.Counter(prime_factorize(int(input())))

a = 0

for i in c.values():
    
    x = 1
    while i > 0:
        i -= x
        a += 1
        x += 1
        
        if i < 0 :
            a -= 1








print(a)

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

N = int(input())


def divisor(n): 
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table













from functools import lru_cache

@lru_cache(None)
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

ans = 0
used = []
while True:
    
    yakusu_table = divisor(N)
    sosu = []
    for yakusu in yakusu_table:
        if is_prime(yakusu):
            sosu.append(yakusu)
    
    yakusu_table.sort()
    
    

    is_ok = False
    for n in yakusu_table:
        if n in used:
            continue
        
        for p in sosu:
            i = 1
            z = 0
            while z <= n:
                z = p ** i
                
                if z == n:
                    

                    is_ok = True
                    break
                i += 1
            if is_ok:
                break
        if is_ok:
            break
    if is_ok:
        
        N = N / z
        used.append(z)
        ans += 1
        continue

    break  

print(ans)

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

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

d = factorization(n)
ins = []
for i in range(len(d)):
    for j in range(1,d[i][1]+1):
        ins.append(d[i][0]**j)
ins.sort()
cnt = 0
for z in ins:
    if n>1:
        if n%z==0:
            n = n//z
            cnt += 1
    else:
        break
print(cnt)

Solution (Python):
n=int(input())
i=1
facts = []
ans = 0
Number  =n
import math 
def factorize(n): 
    count = 0
    while ((n % 2 > 0) == False):  
        n >>= 1;  
        count += 1
    if (count > 0): 
        facts.append(2)
    for i in range(3, int(math.sqrt(n)) + 1): 
        count = 0
        while (n % i == 0):
            count += 1 
            n = int(n / i)
        if (count > 0): 
            facts.append(i)
        i += 2
    if (n > 2): 
        facts.append(n)
factorize(n)
facts = sorted(facts)
for i in range(len(facts)):
    cnt = 1
    while(n >= facts[i]**cnt):
        if(n%(facts[i]**cnt)==0):
            n//=(facts[i]**cnt)
            ans+=1
        cnt+=1
print(ans)

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

def main():
    N=int(input())
    ans=0
    if N==1:
        print(ans)
        return 
    t=prime_decomposition(N)
    if len(t)==1:
        print(1)
        return 
    dic={}
    for a in t:
        if not a in dic.keys():
            dic[a]=1
            continue
        else:
            dic[a]+=1
    ans=0
    for i in dic.keys():
        num=dic[i]
        tmp=1
        c=1
        while True:
            if num >=c:
                num-=c
                c+=1
                ans+=1
            else:
                break
    print(ans)
main()

Solution (Python):

import collections

n = int(input())

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

def cnt(a,b):
    if a >= b:
        return cnt(a-b,b+1)
    else:
        return b - 1
    

c = collections.Counter(prime_factorize(n))
cn = 0
for i in c.values():
    cn += cnt(i,1)

print(cn)

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 main():
    import sys
    N = int(input())
    fact = factorization(N)
    if fact[0][0] == 1:
        print(0)
        sys.exit()
    ans = 0
    for f, num in fact:
        for i in range(1, num+1):
            if num < i:
                break
            num -= i
            ans += 1
    print(ans)
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

N = int(input())

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

c = collections.Counter(prime_factorize(N))

ans = 0
for m in c.values():
	n = 1
	while (n*(n+1))//2 <= m:
		ans += 1
		n += 1
print(ans)

Solution (Python):
from bisect import bisect_right
a = int(input())

l = [1]
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(a)
ans = 0



for i in range(2,45):
    l.append(i+l[-1])

for i,j in f:
    a = bisect_right(l,j)
    
    ans +=a

print(ans)

Solution (Python):
def prime(p):
    memo = []
    for i in range(2,(int(p**0.5)+1)):
        while p%i==0:
            p //= i
            memo.append(i)
    if p != 1:
        memo.append(p)
    return memo

import collections
 
n=int(input())
 
memo = prime(n)

c = collections.Counter(memo)

memo = sorted(c.items(), key=lambda x:-x[0])

if len(memo) == 0:
  print(0)
else: 
  ans = 0
  for i ,j in memo:
    count_kazu = 1
    while 0 <= j-count_kazu:
      j -= count_kazu
      ans += 1
      count_kazu += 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())
count = 0

soinsuu = prime_factorize(n)

soinsuu_set = set(soinsuu)
soinsuu_list = list(soinsuu_set)


for i in range(len(soinsuu_set)):
    z = soinsuu_list[i]
    while n % z == 0:
        n = n / z 
        z = z*soinsuu_list[i]
        count = count + 1
    
print(count)

Solution (Python):
N = int(input())
a = [int(0.5*i*(i+1)) for i in range(10)]
import math
res = 0
top = int(math.sqrt(N))
for i in range(2,top+1):
    count = 0
    while N%i == 0:
        N = N//i
        count += 1
    for j in range(10):
        if count < a[j]:
            res += (j-1)
            break
if N != 1:
    print(res+1)
else:
    print(res)

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

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
for a, b in factorization(N):
  if a == 1:
    print(0)
    exit()
  
  
  t = 0
  for i in range(1, 10+b):
    t += i
    if t > b:
      ans += (i-1)
      break

print(ans)

Solution (Python):




import sys
input = sys.stdin.readline



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

    if M != 1:
        fact.append([M, 1])

    if fact == []:
        fact.append([M, 1])

    return fact


def pert(L):
    cnt = [0 for i in range(L*2)]
    tot = 0
    i = 0
    while tot < L:
        i += 1
        tot += i
        cnt[tot] = i

    temp = 1
    for j in range(1,L+1):
        if cnt[j] == 0:
            cnt[j] += temp
        else:
            temp = 0 + cnt[j]

    return cnt


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

    fact = factorization(N,N,0,[])

    cnt = pert(40)

    M = len(fact)

    res = 0

    for i in range(M):
        now = fact[i]
        if now[0] == 1:
            continue
        res += cnt[now[1]]

    print(res)




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)
    
else:
    a = factorization(n)
    result = 0
    
    for i in range(len(a)):
        j = 1
        while(1):
            a[i][1] -= j
            if a[i][1] < 0:
                break
            result += 1
            j += 1
            
    print(result)

Solution (Python):
import math
import bisect


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


def cal(num):
    D = 1 + 8 * num
    return (-1 + math.sqrt(D))/2


N = int(input())
n_f = factorization(N)
if N == 1:
    print(0)
    exit()
ans = 0
for i in n_f:
    ans += math.floor(cal(i[1]))
print(ans)

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

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

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

    return arr

if N == 1:
    ans = 0
else:
    A = factorization(N)
    B = []
    for a in A:
        B.append(a[1])
        ans = 0
    for b in B:
        n = int((-1 + sqrt(8*b + 1)) / 2)
        ans += n
print(ans)

Solution (Python):

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

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

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

    return arr

L = factorization(n)

ans = 0

for i in range(len(L)):
    b = L[i][1]
    s = 0
    for j in range(1,b+1):
        s += j
        if s == b:
            ans += j
            break
        elif s > b:
            ans += j-1
            break
    
if n == 1:
    ans = 0
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())
if N == 1:
    print(0)
    exit()
L = factorization(N)
res = 0
for l in L:
    a = int(l[1])
    count = 1
    while True:
        if a >= count:
            a -= count
            res += 1
            count += 1
        else:
            break
print(res)

Solution (Python):
import collections

N = int(input())

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

c = collections.Counter(prime_factorize(N))

ans=0
for i in c.values():
    tmp = i
    cnt=0
    val=1
    while True:
        tmp = tmp-val
        val+=1

        if tmp > 0:
            cnt+=1
        
        if tmp == 0:
            cnt+=1
            ans+=cnt
            break
        
        if tmp < 0:
            ans+=cnt
            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


def main():
    n = int(input())
    if n == 1:
        print(0)
    else:
        x = factorization(n)
        
        ans = 0
        for lis in x:
            num = lis[1]
            tmp = 0
            while num > tmp:
                tmp += 1
                ans += 1
                num -= tmp
        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

def resolve():
  N = int(input())
  prime_factors = factorization(N)
  tri_dict = {
    1 :  1,
    2 :  1,
    3 :  2,
    4 :  2,
    5 :  2,
    6 :  3,
    7 :  3,
    8 :  3,
    9 :  3,
    10 :  4,
    11 :  4,
    12 :  4,
    13 :  4,
    14 :  4,
    15 :  5,
    16 :  5,
    17 :  5,
    18 :  5,
    19 :  5,
    20 :  5,
    21 :  6,
    22 :  6,
    23 :  6,
    24 :  6,
    25 :  6,
    26 :  6,
    27 :  6,
    28 :  7,
    29 :  7,
    30 :  7,
    31 :  7,
    32 :  7,
    33 :  7,
    34 :  7,
    35 :  7,
    36 :  8,
    37 :  8,
    38 :  8,
    39 :  8,
    40 :  8,
    41 :  8,
    42 :  8,
    43 :  8,
    44 :  8,
    45 :  9,
    46 :  9,
    47 :  9,
    48 :  9,
    49 :  9,
    50 :  9,
    51 :  9,
    52 :  9,
    53 :  9,
    54 :  9,
    55 :  9,
    56 :  9,
    57 :  9,
    58 :  9,
    59 :  9
  }
  result = 0

  for prime_factor in prime_factors:
    if prime_factor[0] > 1:
      result += tri_dict[prime_factor[1]]

  print(result)


if __name__ == "__main__":
    resolve()

Solution (Python):
import collections
N = int(input())
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
c = collections.Counter(prime_factorize(N))
d = list(c.items())
cnt = 0
for i in range(len(d)):
  for j in range(10 ** 8):
    if j * (j + 1) <= 2 * d[i][1] < (j + 1) * (j + 2):
      cnt += j
      break
    else:
      pass
print(cnt)

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


a = prime_decomposition(n)


d ={}
for i in a:
    if i not in d:
        d[i] = int(0)
    d[i] += 1
    


c = list(d.values())


l =[]
for i in c:
    e = 1
    count = 1
    f = 0
    while i >=  e:
        count += 1
        f += 1 
        e = e + count
    l.append(f)
    
print(sum(l))

Solution (Python):
import math 

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

factorization(24) 
if __name__ == "__main__":
    s = int(input())
    a = factorization(s) 
    if a[0][0] == 1:
        print(0)
    else:
        an = 0
        for list1 in a: 
            z = 0
            check = 0
            count = list1[1]
            while True:
                z += 1
                count -= z
                if count < 0:
                    break
                check += 1
            an += check
        print(an)

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

c = collections.Counter(prime_factorize(N))
sum = 0

for i in c.keys():
    a = c[i]
    for n in range(c[i]):
        if a<n+1:
            break
        else:
            a-=n+1
            sum+=1

print(sum)