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 p_fact(n):
  m=n
  i=2
  a=[]
  while n>1:
    if i>m**.5:
      a+=[n]
      break
    if n%i==0:
      n//=i
      a+=[i]
    else:i+=1
  return a
a=p_fact(int(input()))
d={}
for i in a:
  if d.get(i):d[i]+=1
  else:d[i]=1
ans=0
for i in d:
  j=1
  while d[i]-j>=0:
    ans+=1
    d[i]-=j
    j+=1
print(ans)

Solution (Python):
import collections

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

N = int(input())
if N == 1:
    print(0)
else:
    A = prime_decomposition(N)

    c = collections.Counter(A)
    values, counts = zip(*c.most_common())


    cnt = 0
    for i in range(len(counts)):
        for j in range(10,0,-1):
            if counts[i] >= j * (j + 1)//2:
                cnt += j
                break
    print(cnt)

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

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

count = 0
while lst:
  s = 0
  i = 1
  num = lst[0]
  for ele in lst:
    if ele == num:
      s += 1
  for j in range(s):
    lst.remove(num)
  while s > 0:
    s -= i
    i += 1
    if s >= 0:
      count += 1
  
print(count)

Solution (Python):
def resolve():
    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 = prime_factorize(N)

    count_dict = {}
    total_key = 0
    for i in range(1024):
        total_key += i
        for j in range(total_key-i, total_key):
            count_dict[j] = i-1

    a_element_counter = {}
    for i in a:
        if i not in a_element_counter:
            a_element_counter[i] = 0
        a_element_counter[i] += 1

    ans = 0
    for e in a_element_counter.values():
        ans += count_dict[e]
    print(ans)

if __name__ == "__main__":
    resolve()

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

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

l = prime_factorize(N)

ans = 0
for prime in set(l):
    n_prime = l.count(prime)
    i = 1
    while (i + 2) * (i + 1) / 2 <= n_prime:
        i += 1
    ans += i

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
ans=0
l=len(factorization(n))
s=factorization(n)
for i in range(l):
    for j in range(1,1000):
        if s[i][1]>=j:
            ans+=1
            s[i][1]-=j
        else:
            break
if n==1:
    print(0)
else:
    print(ans)

Solution (Python):
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(math.sqrt(n)) + 2):
        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(stdin.readline().rstrip())
a = factorization(n)

m = 0
for b in a:
    bb = b[1]
    i = 0
    while True:
        bb -= i+1
        if bb >= 0:
            i += 1
        else:
            break
    m = m + i

if n != 1: print(m)
if n == 1: print(0)

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

def primeryNum(n):
    border=int(n**0.5)+1
    ary=list(range(int(n**0.5)+2))
    ary[1]=0
    for a in ary:
        if a>border: break
        elif a==0: continue
        for i in range(a*2,int(n**0.5)+2,a):
            ary[i]=0           
    return ary

primeryNumL=primeryNum(N)

ans=0
N_=N
for x in primeryNumL:
    if x==0 or N%x!=0:
        continue
    n=N
    cnt=0
    while n%x==0:
        cnt+=1
        n/=x
    N_//=x**cnt
    buf=cnt-1
    res=1
    
    for i in range(2,cnt+1):
        if buf<i:
            break
        buf-=i
        res+=1
    ans+=res
if N_>1:
    ans+=1
print(ans)

Solution (Python):
import sys
import math
import numpy as np
from collections import defaultdict
input = sys.stdin.readline


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


def main():
    np.set_printoptions(threshold=20)
    N = int(input())
    d = defaultdict(int)
    for i in range(2, math.ceil(math.sqrt(N))):
        while N % i == 0:
            d[i] += 1
            N //= i
    if N != 1:
        d[N] += 1

    ans = 0
    for key in d:
        val = d[key]
        tmp = 0
        count = 0
        for i in range(1, val):
            tmp += i
            count += 1
            if tmp == val:
                break
            elif tmp > val:
                count -= 1
                break
        ans += max(count, 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(cnt)

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

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

    return arr

A = []
t = 0
for i in range(50):
    t += i
    A.append(t)
import bisect

B = factorization(n)
total = 0

for i in B:
    if i == A[bisect.bisect(A, i)]:
        total += bisect.bisect(A, i)
    else:
        total += bisect.bisect(A, i)-1
if n == 1:
    print(0)
else:
    print(total)

Solution (Python):

from collections import defaultdict

def prime_factor(n):
    d = defaultdict(int)
    for i in range(2, n + 1):
        if i * i > n:
            break

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

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

    return d


N = int(input())
d = prime_factor(N)
ans = 0
for v in d.values():
    i = 1
    res = 0
    while res + i <= v:
        res += i
        i += 1
    ans += i - 1

print(ans)

Solution (Python):
import math
from collections import Counter

def get_prime_factors(n):
    if n == 1:
        return []
    else:
        limit = int(math.sqrt(n))
        for i in range(2, limit + 1):
            if n % i == 0:
                return [i] + get_prime_factors(n // i)
        return [n]


N = int(input())

operations = 0
prime_factors = get_prime_factors(N)
for p, count in Counter(prime_factors).items():
    for i in range(1, count + 1):
        if i <= count:
            operations += 1
            count -= i
        else:
            break
print(operations)

Solution (Python):
def input_int():
    return map(int, input().split())

def one_int():
    return int(input())

def one_str():
    return input()

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

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

temp = factorization(N)
temp = sorted(temp, key= lambda x: x[0])





output_set = []
output = [ output_set + [t[0]]*t[1] for t in temp ]

count = 0
for i in output:
    temp = len(i)
    sums = 0
    for t in range(1,temp+1):
        sums += t
        if temp >= sums:
            count += 1

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

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

cnt = collections.Counter(prime_factorize(N))
ans = 0

for val in cnt.values():
    
    m = 1
    while m*(m+1)//2 <= val:
        m += 1
    ans += m-1

print(ans)

Solution (Python):

def solve():
    N=n=int(input())
    q=int(n**0.5)
    ans=0
    for d in range(2,q+1) :
        a=0
        while n % d == 0 :
            a+=1
            n//=d
        if a>0 :
            ans+=int(((a*8+1)**0.5-1)/2)
    if n > 1 :
        ans+=1
    return ans

print(solve())

Solution (Python):
def prime_fac(x):
    pfs = {1}
    for i in range(2, x):
        if i * i > x:
            break
        while x % i == 0:
            pfs.add(i)
            x //= i
    pfs.add(x)
    return pfs


n = int(input())
xs = prime_fac(n)
xs.remove(1)
ans = 0
for v in xs:
    t = v
    while n % t == 0:
        n //= t
        t *= v
        ans += 1
print(ans)

Solution (Python):
from collections import Counter

N=int(input())
N_=N
f_=[]
for n in range(2,int(N**(1/2))+2):    
    while N_ % n==0: 
        N_=int(N_/n)
        f_.append(n)
        
if N_ != 1:
	f_.append(N_)
    
C=Counter(f_)
N_=N
ans=0
for c in C.keys():
    for c_ in range(1,C[c]+1):
        if N_ % c**c_ == 0:
            N_ = N_/c**c_
            ans+=1
if N==1:
    ans=0
print(ans)

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

def factorization(num):
    res = []
    n = num
    div_max = int(num ** 0.5)
    for i in range(2, div_max+1):
        if n % i == 0:
            count = 0
            while n % i == 0:
                count += 1
                n //= i
            res.append([i, count])

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

    if len(res) == 0:
        res.append([num, 1])

    return res

res = factorization(N)

ans = 0
for i in range(len(res)):

    p, n = res[i]
    if p != 1:
        j = 1
        while n - j >= 0:
            ans += 1
            n -= j
            j += 1

print(ans)

Solution (Python):
import itertools

n = int(input())
ans = 0


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 q(m):
    check = 0
    while m >= check * (check + 1) / 2:
        check += 1
    return check - 1


a = prime_factorize(n)
gr = itertools.groupby(a)
for key, group in gr:
    ans += q(len(list(group)))

print(ans)

Solution (Python):
def INT():
    return int(input())

def MI():
    return map(int, input().split())

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

from math import sqrt

N = INT()
tmp = N
fact = {}

for n in range(2, int(sqrt(N)) + 1):
    if tmp == 1:
        break
    
    e = 0
    while 1:
        if tmp % n != 0:
            break
        tmp //= n
        e += 1
    
    if e == 0:
        continue

    fact[n] = e

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

if fact == {}:
    fact[N] = 1

ans = 0

for p in fact.keys():
    e = 1
    z = p
    
    if N == 1:
        break
    
    while 1:
        if N % z != 0:
            break
        N //= z
        e += 1
        z = pow(p, e)
        ans += 1
        
print(ans)

Solution (Python):
def INT():
    return int(input())

def MI():
    return map(int, input().split())

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

from math import sqrt

N = INT()
tmp = N
fact = {}
is_prime = True

for n in range(2, int(sqrt(N)) + 1):
    if tmp == 1:
        break
    
    e = 0
    while 1:
        if tmp % n != 0:
            break
        tmp //= n
        e += 1
    
    if e == 0:
        continue

    fact[n] = e

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

if fact == {}:
    fact[N] = 1

ans = 0

for p in fact.keys():
    e = 1
    z = p
    
    if N == 1:
        break
    
    while 1:
        if N % z != 0:
            break
        N //= z
        e += 1
        z = pow(p, e)
        ans += 1
        
print(ans)

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())
D = collections.Counter(prime_factorize(N))
A=0
for d in D:
    e=D[d]
    for i in range(40):
        if (i+1)*(i+2)>2*e:
            A=A+i
            break
print(A)

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

ans =0
for i in range(2,int(n**0.5)+5):
    cnt = 0
    while n%i==0:
        n//=i
        cnt += 1
    s=1
    while cnt-s>=0:
        cnt -= s
        s +=1
        ans += 1
if n!=1:ans+=1
print(ans)

Solution (Python):
import math
n=int(input());
arr=[]
j=2
while j*j<=n:
	cnt=0
	while n%j==0:
		cnt=cnt+1
		n=n/j
	if cnt!=0:
		arr.append(cnt)
	j=j+1
if n>1:
	arr.append(1)
ans=int(0)
for i in arr:
	ans=ans+int((math.sqrt(1+8*i)-1)/2)
print(ans)

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)
list_num=[]
for i,n in enumerate(a):
  if i ==0:
    list_num.append(n)
  if n in list_num:
    continue
  elif n not in list_num:
    list_num.append(n)
count = 0
for i in list_num:
  num = a.count(i)
  handan = True
  j = 1
  counter = 0
  while handan == True:
    num -=j
    if num<0:
      handan =False
    elif num>=0:
      counter+=1
      j+=1
  count +=counter

print(count)

Solution (Python):


import itertools
import collections
from decimal import Decimal





def main():
    n = int(input())
    p = prime_factorize(n)
    cp = collections.Counter(p)
    ans = 0
    for c, num in cp.items():
        count = 0
        jou = 1
        for _ in range(num):
            count += 1
            if count == jou:
                count = 0
                jou += 1
                ans += 1
    print(ans)

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 bfs(H, W, black_cells, dist):
    d = 0
    while black_cells:
        h, w = black_cells.popleft()
        d = dist[h][w]
        for dy, dx in ((1, 0), (0, 1), (-1, 0), (0, -1)):
            new_h = h + dy
            new_w = w + dx
            if new_h < 0 or H <= new_h or new_w < 0 or W <= new_w:
                continue
            if dist[new_h][new_w] == -1:
                dist[new_h][new_w] = d + 1
                black_cells.append((new_h, new_w))
    return d


def input_list():
    return list(map(Decimal, input().split()))


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


if __name__ == "__main__":
    main()

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


hash = {}
end = int(N ** (1/2))
for i in range(2, end + 1):
    while N % i == 0:
        hash[i] = hash.get(i, 0) + 1
        N = N // i
if N != 1:
        hash[i] = hash.get(i, 0) + 1


count = 1
res = 0
for i in hash.values():
    count = 1
    while i >= count:
        res += 1
        i -= count
        count += 1

print(res)

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


hash = {}
end = int(N ** (1/2))
for i in range(2, end + 1):
    while N % i == 0:
        hash[i] = hash.get(i, 0) + 1
        N = N // i
if N != 1:
        hash[i] = hash.get(i, 0) + 1



count = 0
trans = [1, 3, 6, 10, 15, 21, 28, 36, 45, 55]

res = 0
for i in hash.values():
    for j in range(len(trans)):
        if i > trans[j]:
            continue
        elif i == trans[j]:
            res += (j + 1)
            break
        else:
            res += j
            break



print(res)

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


hash = {}
end = int(N ** (1/2))
for i in range(2, end + 1):
    while N % i == 0:
        if i in hash:
            hash[i] += 1
        else:
            hash[i] = 1
        N = N // i
if N != 1:
        if N in hash:
            hash[N] += 1
        else:
            hash[N] = 1

if len(hash.keys()) == 0 and N != 1:
    print(1)
    exit()


count = 0
trans = [1, 3, 6, 10, 15, 21, 28, 36, 45, 55]

res = 0
for i in hash.values():
    for j in range(len(trans)):
        if i > trans[j]:
            continue
        elif i == trans[j]:
            res += (j + 1)
            break
        else:
            res += j
            break



print(res)

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

n = int(input())
fac_list = factorization(n)
ans = 0

for x in fac_list:
    tmp = 1
    while x - tmp >= 0:
        x -= tmp
        tmp += 1
        ans += 1

print(ans if n != 1 else 0)

Solution (Python):
import math


def is_prime(n):
    for i in range(2, int(math.sqrt(n))+1):
        if n%i == 0:
            return False
    return True      


def getPrime(n):
    n_sqrt = int(math.sqrt(n))
    array = [True]*(n_sqrt+1)
    result = []
    for i in range(2, n_sqrt+1):
        if array[i]:
            array[i] = False
            result.append(i)
            for j in range(i*2, n_sqrt+1, i):
                array[j] = False
    return result

N = int(input())
n = N
prime = getPrime(n)
prime_exp = []

for p in prime:
    cnt = 0
    while n%p == 0:
        n = int(n/p)
        
        cnt += 1
    if cnt != 0:
        prime_exp.append([p, cnt])
if is_prime(n) and n != 1:
    prime_exp.append([n, 1])
ans = 0
for pe in prime_exp:
    ans += int((-1+math.sqrt(1+8*pe[1]))/2)
print(ans)

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))
cc=list(c.keys())
def countcheck(x):
  a=0
  aa=0
  b=[1]
  while x>=a:
    a+=b[-1]
    c=b[-1]+1
    b.append(c)
    if x>=a:
      aa+=1
    
  return aa

ans=0

for x in range(len(cc)):
  dd=cc[x]
  d=c[dd]
  e=countcheck(d)
  ans+=e
  
print(ans)

Solution (Python):
import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

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 = inp()
if n == 1:
    print(0)
    exit()

f = factorization(n)

ans = 0
for i in range(len(f)):
    sum = f[i][1]
    tmp = 0
    if sum == 1:
        ans += 1
    else:
        for j in range(1,int(sum)):
            tmp += j
            if tmp > sum:
                break
            ans += 1

print(ans)

Solution (Python):
import collections
n = int(input())
arr = collections.Counter()
def factorize(num):
    while num % 2 == 0:
        arr[2] += 1
        num //= 2
    f = 3
    while f ** 2 <= n:
        if num % f == 0:
            arr[f] += 1
            num //= f
        else:
            f += 2
    if num != 1:
        arr[num] = 1

factorize(n)
varr = list(arr.values())
ans = 0
for i in varr:
    c = 0
    while c < i:
        ans += 1
        c += 1
        i -= c
print(ans)

Solution (Python):
import collections
n = int(input())
arr = collections.Counter()
def factorize(num):
    while num % 2 == 0:
        arr[2] += 1
        num //= 2
    f = 3
    while f ** 2 <= n:
        if num % f == 0:
            arr[f] += 1
            num //= f
        else:
            f += 2
    if num != 1:
        arr[num] = 1

factorize(n)
varr = list(arr.values())
ans = 0
for i in varr:
    c = 1
    while c <= i:
        i -= c
        ans += 1
        c += 1
print(ans)

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

def prime_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 solve():
    if N==1:
        print(0)
        return

    pri_arr=prime_factorization(N)
    ans=0

    for i in range(len(pri_arr)):
        e=pri_arr[i][1]
        temp=0
        cur=1

        while e>=cur:
            e-=cur
            cur+=1
            temp+=1
        
        ans+=temp

    print(ans)
    
if __name__ == "__main__":
     solve()

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

def getpattern(x):
  pattern = 0
  d = 0
  for i in range(1, 1000000):
    d += i
    if x < d:
      break
    pattern += 1
  return pattern

n = int(input())
f = factorize(n)
fu = set(factorize(n))
r = 0
for fui in fu:
  r += getpattern(f.count(fui))
print(r)

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

cnt = 0
n = int(input())



f_list = factorization(n)

for item in f_list:
  power = item[1]
  counter = 1
  while(True):
    power -= counter
    if power<0:
      break
    cnt+=1
    counter+=1
if n == 1:
  cnt = 0
print(cnt)

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

a = prime_factorize(N)
num = list(Counter(a).values())

ans = 0
for i in num:
    j = 1
    while i - j >= 0:
        ans += 1
        i -= j
        j += 1
 
print(ans)

Solution (Python):
import collections

def primes(n): 
 cnt=collections.defaultdict(int)
 for i in range(2,int(n**0.5)+1):
   if n%i==0:
     while n%i==0:
       cnt[i]+=1
       n//=i
 if n!=1:
   cnt[n]+=1
 return cnt

n=int(input())
cnt=primes(n)
ans=0
for key in cnt.keys():
 val=cnt[key]
 for i in range(100): 
   if (i*(i+1))//2>val:
     ans+=i-1
     break
print(ans)

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


ans = 0

a = collections.Counter(prime_factorize(n))

for i in a.keys():
    for j in range(1, a[i]+1):  
        if a[i] < j:
            break
        else:
            a[i] -= j
            ans += 1
        

print(ans)

Solution (Python):
from math import *
from collections import Counter
def factorize(n):
	res = []
	while n%2 == 0:
		res.append(2)
		n = n//2
	for i in range(3,int(sqrt(n))+1,2):
		while n%i == 0:
			res.append(i)
			n = n//i
	if n > 2:
		res.append(n)

	return set(res)

n = int(input())
primes = factorize(n)
ans = 0
for i in primes:
	c = i
	while n%c == 0:
		n = n // c
		c = c * i
		ans+=1
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

def add(X):
    counter = 0
    while True:
        if counter * (counter + 1) <= X * 2:
            counter += 1
        else:
            counter -= 1
            break
    
    return counter

facts = factorization(N)
answer = 0
for f in facts:
    if f[0] != 1:
        answer += add(f[1])
print(answer)

Solution (Python):

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

n = int(input())
a = [0]*(int(n**0.5)+1)
cnt=1
for i in range(1,len(a)):
    for j in range(cnt,cnt+i+1):
        if j < len(a):
            a[j] = i
            cnt += 1
        else:
            break
sum = 0
insu = soinsu(n)

for i in range(len(insu)):
    sum += a[insu[i][1]]
print(sum)

Solution (Python):
n = int(input())
if n == 1:
    print(0)
else:
    cnt_ls = [0] * 41
    cnt = 0
    add = 1
    for i in range(1, 41):
        cnt_ls[i] = add
        cnt += 1
        if cnt == add + 1:
            add += 1
            cnt = 0

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

    ans = 0
    for i in f_ls:
        ans += cnt_ls[i]

    print(ans)

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

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

import collections
c = collections.Counter(prime_factorize(n))
ans = 0
for _,value in c.items():
    i = 0
    while value>i:
        i += 1
        value -= i
    ans += i
print(ans)

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


def prime_factorize(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(readline())

p = prime_factorize(n)

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

ans = 0
for f, c in p:
    cnt = 0
    while c >= cnt+1:
        c -= cnt+1
        cnt += 1
    ans += cnt
print(ans)

Solution (Python):

import sys
import math


def II(): return int(sys.stdin.readline())


def MI(): return map(int, sys.stdin.readline().split())


def LI(): return list(map(int, sys.stdin.readline().split()))


def generate_primes(n):
    if n < 2:
        return []
    is_prime_array = [True] * (n + 1)
    is_prime_array[0], is_prime_array[1] = False, False
    for i in range(2, n+1):
        if is_prime_array[i]:
            k = 2 * i
            while k < n + 1:
                is_prime_array[k] = False
                k += i
    return list(filter(lambda i: is_prime_array[i], range(n+1)))


def main():
    N = II()
    if N <= 1:
        print(0)
        exit()
    max_prime = math.ceil(N**0.5)
    primes = generate_primes(max_prime)
    es = [0] * len(primes)
    for i in range(len(primes)):
        while N % primes[i] == 0:
            N /= primes[i]
            es[i] += 1

    ans = 0
    if int(N) != 1:
        ans += 1

    for i in range(len(es)):
        k = 1
        while es[i] - k >= 0:
            es[i] -= k
            k += 1
            ans += 1

    print(ans)


main()