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

Solution (Python):

import math


def inp():
    return(int(input()))



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



def instr():
    s = input()
    return(list(s[:len(s)]))



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


def prime_factors(n):
    factors = set()

    for i in range(2, int(math.sqrt(n+1)+1)):
        while n % i == 0:
            factors.add(i)
            n = int(n/i)
    if n >= 2:
        factors.add(n)
    return factors


n = inp()

fac = prime_factors(n)
res = 0
for f in fac:
    i = 1
    while n % f**i == 0:
        res += 1
        
        n = n // (f**i)

        i += 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


factors = factorization(N)
l = []
for factor in factors:
    for i in range(factor[1]):
        l.append(factor[0]**(i + 1))
l.sort()

ans = 0
for val in l:
    if N == 1:
        break

    if N % val == 0:
        N /= val
        ans += 1

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
factors = dict(collections.Counter(prime_factorize(N)))

num = 0
for f in factors.keys():
    size = 1
    while factors[f] >= size:
        factors[f] -= size
        num += 1
        size += 1

print(num)

Solution (Python):
import collections
def pf(N):
    res = []
    x = N
    y = 2
    while y*y <= x:
        while x % y == 0:
            res.append(y)
            x //= y
        y += 1
    if x > 1:
        res.append(x)
    return res

cnt = collections.Counter(pf(int(input())))
ans = 0
for x in cnt:
    tmp = 1
    while cnt[x] > 0:
        cnt[x] -= tmp
        if cnt[x] < 0:
            break
        tmp += 1
        ans += 1
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
if n > 1:
    tmp = collections.Counter(prime_factorize(n))
    for v in tmp.values():
        i = 1
        while v > 0:
            if v - i >= 0:
                v -= i
                ans += 1
                i += 1
            else:
                break
print(ans)

Solution (Python):
from heapq import heappush, heappop
from collections import defaultdict

N = int(input())

def primeFactorization(N):
    primes = defaultdict(int)
    R = int(N**(0.5)) + 1
    for num in range(2, R):
        while N % num == 0:
            N //= num
            primes[num] += 1
    if N > 1 :
        primes[N] = 1
    return primes

primes = primeFactorization(N).keys()

que = []
for p in primes:
    heappush(que, (p, p))

ans = 0
while que and N > 0:
    z, p = heappop(que)
    if N % z == 0:
        ans += 1
        N //= z

        heappush(que, (z * p, p))

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


f = factorization(N)
total = 0
for c in f:
    if c[0] == 1:
        continue
    target = c[1]
    cnt = 0
    for i in range(1, c[1] + 1):
        target -= i
        if target < 0:
            break
        cnt += 1
    total += cnt

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

def main():
  n = int(input())
  lst = factorization(n)

  ans = 0
  for a, b in lst:
    if a == 1:
      continue

    i = 1
    while i <= b:
      b -= i
      i += 1
      ans += 1

  print(ans)

main()

Solution (Python):
n=int(input())
b=[1,1,2,2,2,3,3,3,3,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,8,8,8,8,8]

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)
s=0
if n==1:
    print(0)
else:
    for i in range(len(a)):
        s+=b[a[i][1]-1]
    print(s)

Solution (Python):
n = int(input())
d = []
c = 0
while n % 2 == 0:
    c += 1
    n //= 2
if c > 0:
    d.append(c)
p = 3
while p*p <= n:
    c = 0
    while n % p == 0:
        c += 1
        n //= p
    if c > 0:
        d.append(c)
    p += 2
if n > 1:
    d.append(1)
ans = 0
for x in d:
    c = 1
    while x >= c:
        ans += 1
        x -= c
        c += 1
print(ans)

Solution (Python):
n=int(input())
d=dict()
for i in range(1,int(n**0.5)+1):
    cnt=0
    while n%(i+1)==0:
        n//=i+1
        cnt+=1
    d[i+1]=cnt
if n>1:
    if n in d:
        d[n]+=1
    else:
        d[n]=1
ans=0
d=list(d.items())
for i,r in d:
    for j in range(1,44):
        if j*(j+1)//2>r:
            ans+=j-1
            break
print(ans)

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

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

ans=0
for prime,count in primes:
    cnt=1
    tmp=1
    while True:
        if tmp>count:
            break
        ans+=1
        cnt+=1
        tmp+=cnt
print(ans)

Solution (Python):
n = int(input())
pf = {}

for i in range(2, int(n**0.5) + 1):
    while not n % i:
        pf[i] = pf.get(i, 0) + 1
        n //= i
if n > 1:
    pf[n] = 1


cnt = 0
for i in pf.values():
    for j in range(1, 50):
        if i - j >= 0:
            cnt += 1
            i -= j
        else:
            break
print(cnt)

Solution (Python):
n=int(input())
if n==1:
    print(0)
else:
    lst=[]
    i=2
    while i**2<=n:
        if n%i==0:
            n//=i
            lst.append(i)
            continue
        i+=1
    lst.append(n)
    from collections import Counter
    dic=dict(Counter(lst))
    s=0
    for i in dic:
        n=dic[i]
        k=0
        while n>=0:
            s+=1
            k+=1
            n-=k
        s-=1
    print(s)

Solution (Python):
from math import floor,sqrt
def prime(n):
    a = []
    d={}
    while n % 2 == 0:
        try:
            d[2]+=1
        except:
            d[2]=1
            a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            try:
                d[f]+=1
            except:
                d[f]=1
                a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        try:
            d[n]+=1
        except:
            d[n]=1
            a.append(n)
    return a,d
n=int(input())
a,d=prime(n)
ans=0
for i in range(len(a)):
    k=floor(sqrt(2*d[a[i]]))
    if k*(k+1)//2>d[a[i]]:
        k-=1
    ans+=k
print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(10**6)

n = int(input())









pf = {}

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

ans = 0

for v in pf.values():
    
    l = 1; r = v 

    while l+1 < r:
        c = (l+r)//2
        if c*(c+1)/2 <= v:
            l = c
        else:
            r = c
    ans += l

print(ans)

Solution (Python):
import collections

def prime_factorize(x):
    factor = []
    while x % 2 == 0:
        x //= 2
        factor.append(2)
    div = 3
    while div ** 2 <= x:
        if x % div == 0:
            x //= div
            factor.append(div)
        else:
            div += 2
    if x != 1:
        factor.append(x)
    return collections.Counter(factor)

n = int(input())
ans = 0
for x in prime_factorize(n).values():
    tmp = 0
    check = 1
    i = 2
    while check <= x:
        check += i
        tmp += 1
        i += 1
    ans += tmp
print(ans)

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

N = int(input())
fac = []
fac = factorization(N)



def sankaku(x):
    ans = 0
    for i in range(int(2*math.sqrt(x))):
        if i*(i+1)//2 < x:
            ans += 1
        else:
            pass
    return ans

def truesan(x):
    return sankaku(x+1)-1



a = 0
for i in range(len(fac)):
    a += truesan(fac[i][1])

print(a if N != 1 else 0)

Solution (Python):
import sys
import math

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


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


def return_N(n):
    prob = math.floor(math.sqrt(2*n))
    if (prob -1 ) * (prob ) <= 2*n < (prob + 1) * (prob):
        return  prob -1
    elif (prob -2 ) * (prob -1) <= 2*n < (prob -1) * (prob):
        return prob - 2
    elif (prob) * (prob + 1) <= 2*n < (prob + 1) * (prob +2):
        return prob

    
    
N = int(readline())
PP = prime_list(N)
ans = 0 
for i in range(len(PP)):
    ans += return_N(PP[i][1])
print(ans)

Solution (Python):
from collections import Counter


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


def div_count(primes: dict) -> int:
    cnt = 0
    for _, c in primes.items():
        i = 1
        while True:
            if c < i:
                break
            cnt += 1
            c -= i
            i += 1

    return cnt


if __name__ == "__main__":
    n = int(input())
    primes = Counter(prime_factorize(n))
    print(div_count(primes))

Solution (Python):
import sys
import numpy as np
import math
import random
from decimal import Decimal
import itertools
import re
from collections import deque, Counter
from functools import lru_cache

sys.setrecursionlimit(2147483647)
INF = 10**13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007

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 = I()
	factos = factorization(n)
	count = 0
	for num, facto in factos:
		sum_tmp = 0
		for i in range(1,facto+1):
			sum_tmp += i
			if sum_tmp <= facto:
				count += 1
	if n == 1:
		print(0)
	else:
		print(count)


if __name__ == '__main__':
    main()

Solution (Python):
import collections


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


n = int(input())
c = collections.Counter(prime_factorize(n))


count = 0
for k, v in c.items():
    sum = 0
    for i in range(1, 10 ** 10):
        sum += i
        if sum > v:
            break
        count += 1
print(count)

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

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

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

    return arr

num = int(input())
val = factorization(num)
ans = 0
for x in val:
    if x[0] == 1: break
    val = 0
    for i in range(40):
        val += i + 1
        if x[1] < val:
            ans += i
            break
print(ans)

Solution (Python):
from collections import Counter
n = int(input())
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)

c = Counter(a)
ans = 0
loop = True
for i in c.values():
    x = 1
    while loop == True:
        if x * (x + 1) // 2 <= i < (x + 1) * (x + 2) // 2:
            break
        x += 1
    ans += x
print(ans)

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


def prime_factorize(n):
    """素因数分解し，ユニークな素因数のsetを返す。"""
    ans = []
    ans_add = ans.append
    while n % 2 == 0:
        ans_add(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            ans_add(f)
            n //= f
        else:
            f += 2
    if n != 1:
        ans_add(n)
    return ans


def main():
    n = int(input())
    primes = prime_factorize(n)
    acc = tuple(accumulate(range(1, 42)))
    counted = Counter(primes)
    ans = 0

    for c in counted.values():
        for i, x in enumerate(acc):
            if c >= x:
                tmp = i + 1
            else:
                break
        ans += tmp

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):

import collections


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

    if arr[0] == [1, 1]:
        return []

    return arr


n = int(input())
fact_list = factorization(n)


ans = 0
for num, exp in fact_list:

    for i in range(1, exp+1):
        if exp-i >= 0:
            ans += 1
            exp -= i
        else:
            break

print(ans)

Solution (Python):
import math




def solve(n):
    ans = 0
    for i in range(2, int(math.sqrt(n) + 2)):
        if n % i == 0:
            times = 0
            needed = 1
            while n % i ==0:
                times += 1
                if times>= needed:
                    times = 0
                    needed += 1
                    ans += 1
                n //= i
    if not n == 1:
        print(ans+1)
    else:
        print(ans)
    return



n = int(input())
solve(n)

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

a = [0 for _ in range(40)]
start = 0
for i in range(8):
    a[start:start+(i+2)] = [i+1 for _ in range(i+2)]
    start = start + (i+2)

ans = 0
for i in list(c.values()):
    ans += a[i-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 

import math
import sys
n = int(input())
ls = factorization(n)
q = 0
if n == 1:
    print(0)
    sys.exit()
for i in range(len(ls)):
    j = 1
    k = 2
    p = 0
    while True:
        if ls[i][1] >= j:
            j += k
            p += 1
            k += 1
        else:
            break
    q += p
print(q)

Solution (Python):
"""素因数分解"""
def prime_decomposition(n):
    i = 2
    tank = []
    while i * i <= n:
        while n%i == 0:
            n /= i
            tank.append(i)
        i += 1
    if n > 1:
        tank.append(int(n))
    return tank

from collections import Counter

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

lst = prime_decomposition(n)
c = Counter(lst)
ans = 0

for k,v in c.items():
    j = 1
    while True:
        if j*(j+1)//2 <=v:
            j += 1
        else:
            break
    ans += j-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

ans = factorization(n)
val = 0
for arr in ans:
    tmp = arr[1]
    for i in range(1,50):
        tmp = tmp -(i)
        if tmp < 0:
            val +=i - 1
            break
if n == 1:
    print(0)
else:
    print(val)

Solution (Python):
n = int(input())
cnt = 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)
cnt = 0
for i in arr:
    if i[0] == 1:
        continue
    hiku = 1
    while i[1] > 0:
        i[1] = i[1] - hiku
        if i[1] < 0:
            break
        hiku +=1
        cnt += 1

print(cnt)

Solution (Python):


import re
import math
from collections import defaultdict
from collections import deque
import collections
from fractions import Fraction
import bisect
from queue import PriorityQueue
import itertools
from copy import deepcopy
import random
import time
import os
import sys
import datetime
from functools import lru_cache
from functools import reduce
readline=sys.stdin.readline
sys.setrecursionlimit(2000000)
alphabet="abcdefghijklmnopqrstuvwxyz"
numbers="0123456789"
mod=int(10**9+7)
inf=int(10**19)
class Edge():
    def __init__(self,x,y,val=1):
        self.x=x
        self.y=y
        self.val=val
class unionfind():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(n)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):
            self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def yn(b):
    if b:print("yes")
    else:print("no")
def Yn(b):
    if b:print("Yes")
    else:print("No")
def YN(b):
    if b:print("YES")
    else:print("NO")
def ispow(a,b):
    now=b
    while now<a:
        now*=b
    return now==a
def getbin(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def getfacs(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod_>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def nextcomb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:return num
def getprimes(n):
    if n==0:return []
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    ret=[]
    for a in range(n+1):
        if(A[a]):ret.append(a)
    return ret
def isprime(num):
    if(num<=1):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def ifelse(bbool,ret1,ret2):
    if bbool:return ret1
    else:return  ret2
def join(A,c=" "):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s
def factorize(n):
    b = 2
    ret=defaultdict(int)
    while b * b <= n:
        while n % b == 0:
            n //= b
            ret[b]+=1
        b+=1
    if n > 1:ret[n]+=1
    return ret
def pm(x):
    return x//abs(x)
def inputintlist(): 
    return list(map(int,input().split()))
def istanchouzouka(A):
    f=True
    prev=min(A)-1
    for a in A:
        if prev>=a:
            f=False
        prev=a
    return f
def istanchouhigensyou(A):
    f=True
    prev=min(A)-1
    for a in A:
        if prev>a:
            f=False
        prev=a
    return f
def getallsum(A):
    s=sum(A)
    dp=defaultdict(int)
    dp[0]=1
    for a in range(0,len(A)):
        for b in range(s,-1,-1):
            if b-A[a]>=0:
                dp[b]+=dp[b-A[a]]
    return dp
def yuukoutomukou(edges):
    ret=deepcopy(edges)
    for edge in edges:
        if not edge.x==edge.y:
            ret.append(Edge(edge.y,edge.x,edge.val))
    return ret
def dijkstra(edges,V,start):
    mincost=[inf]*V
    G=[[] for a in range(V)]
    for edge in edges:
        G[edge.x].append([edge.val,edge.y])
    Q=PriorityQueue()
    Q.put([0,start])
    while not Q.empty():
        nowcost,nowx=Q.get()
        if mincost[nowx]==inf:
            mincost[nowx]=nowcost
            for cost,y in G[nowx]:
                newcost=nowcost+cost
                Q.put([newcost,y])
    return mincost
def warshallfloyd(edges,V):
    mincost=[[inf for b in range(V)] for a in range(V)]
    for a in range(V):mincost[a][a]=0
    for edge in edges:
        mincost[edge.x][edge.y]=min(mincost[edge.x][edge.y],edge.val)
    for k in range(V):
        for s in range(V):
            for t in range(V):
                if mincost[s][k]==inf or mincost[k][t]==inf:continue
                mincost[s][t]=min(mincost[s][t],mincost[s][k]+mincost[k][t])
    return mincost
def bellemanford(edges,V,start):
    mincost=[inf]*V
    mincost[start]=0
    for _ in range(V):
        for edge in edges:
            if mincost[edge.x]==inf:continue
            mincost[edge.y]=min(mincost[edge.y],mincost[edge.x]+edge.val)
    return mincost
def ruisekiwa(A):
    ret=[0]*(len(A)+1)
    for a in range(len(A)):
        ret[a+1]=ret[a]+A[a]
    return ret
def getmd(x1,y1,x2,y2):
    return abs(x1-x2)+abs(y1-y2)
def geted(x1,y1,x2,y2):
    return math.sqrt((x1-x2)**2+(y1-y2)**2)
class fordfulkerson():
    def __init__(self,edges,V,s,t):
        self.V=V
        self.used=[False]*V
        self.G=[[] for a in range(V)]
        self.s=s
        self.t=t
        for edge in edges:
            self.G[edge.x].append({"x":edge.x,"y":edge.y,"cap":edge.val,"rev":len(self.G[edge.y])})
            self.G[edge.y].append({"x":edge.y,"y":edge.x,"cap":0,"rev":len(self.G[edge.x])-1})
    def dfs(self,v,t,f=inf):
        if v==t:return f
        self.used[v]=True
        for a in range(len(self.G[v])):
            x=self.G[v][a]["x"]
            y=self.G[v][a]["y"]
            cap=self.G[v][a]["cap"]
            rev=self.G[y][self.G[x][a]["rev"]]
            if self.used[y] or cap==0:continue
            f2=self.dfs(y,t,min(f,cap))
            if f2>0:
                self.G[v][a]["cap"]-=f2
                rev["cap"]+=f2
                return f2
        return 0
    def maxflow(self):
        flow=0
        while True:
            self.used=[False]*V
            zouka=self.dfs(self.s,self.t)
            if zouka==0:break
            flow+=zouka
        return flow




n=int(input())
ans=0
A=[0]
for a in range(1,10000):
    A.append(a+A[-1])
fac=factorize(n)
for a,cnt in fac.items():
    i=bisect.bisect_right(A,cnt,lo = 0,hi = len(A))-1
    ans+=i

print(ans)

Solution (Python):
def main():
    def factorization(num):
        result = []
        count = 0
        temp = num
        for i in range(2, int(num ** 0.5) + 1):
            if temp % i == 0:
                count = 0
                while temp % i == 0:
                    count += 1
                    temp /= i
                result.append(count)
        if temp != 1:
            result.append(1)
        return result
    C = []
    c = 0
    for i in range(1, 40):
        c += i
        C.append(c)
    def combi(num, C):
        for i, c in enumerate(C):
            if num < c:
                return i
        return -1
    n = int(input())
    exps = factorization(n)
    count = 0
    for e in exps:
        count += combi(e, C)
    print(count)


if __name__ == '__main__':
    main()

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

def prime(n):
    factor = {}
    tmp = int(math.sqrt(n)) + 1
    for num in range(2, tmp):
        while n % num == 0:
            n //= num
            if not num in factor.keys():
                factor[num] = 1
            else:
                factor[num] += 1
        if num > n:
            break
    if n != 1:
        if not n in factor.keys():
            factor[n] = 1
        else:
            factor[n] += 1
    return factor



ans = 0


pr = prime(n)
for num, count in pr.items():
    tmp = count
    ini = 1
    while tmp > 0:
        tmp -= ini
        if tmp < 0:
            break
        ini += 1
        ans += 1
    

print(ans)

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

n = int(input())


from collections import Counter
def prime_factorize(n):
    d = Counter()
    m = 2
    while m*m <= n:
        while n%m == 0:
            n //= m
            d[m] += 1
        m += 1
    if n > 1:
        d[n] += 1
    return d

soinsu = prime_factorize(n)

sankaku = [1]*20

from bisect import bisect_right

for i in range(1,20):
    sankaku[i] = sankaku[i-1]+(i+1)

ans=0
for k,v in soinsu.items():
    index = bisect_right(sankaku,v)
    ans += index

print(ans)

Solution (Python):
from collections import deque, Counter
def prime_factorize(n):
    a = deque([])
    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())
A = Counter(prime_factorize(N))
B = [1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66]
ans = 0
for i in A:
    for j in range(len(B)):
        if B[j] <= A[i] < B[j + 1]:
            ans += (j + 1)
            break
print(ans)

Solution (Python):
N = int(input())
ans = 0
for i in range(2,int(N**(1/2)//1)+1):
  if N%i == 0:
    cnt = 0
    while N%i == 0:
      N //= i
      cnt += 1
    for j in range(1,cnt+1):
      if cnt - j >=0:
        cnt -= j
        ans += 1
      else:
        break
  else:
    continue   
if N != 1:
  ans += 1     
print(ans)

Solution (Python):
import sys
from collections import defaultdict

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60

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

def main():
    N = int(readline())
    a = prime_factorize(N)
    
    ans = 0
    for power in a.values():
        ans += int(((1 + 8 * power) ** 0.5 - 1 ) / 2)
        
    print(ans)
    return


if __name__ == '__main__':
    main()

Solution (Python):
from math import sqrt

def fact(n):
    F_dict,F_set = {},set()
    for i in range(2,int(sqrt(n))+1):
        if n % i == 0:
            F_dict[i] = 1
            F_set.add(i)
            n //= i
            while n % i == 0:
                F_dict[i] += 1
                n //= i
        if n == 1:
            break

    if n != 1:
        F_dict[n] = 1
        F_set.add(n)

    return (F_dict,F_set)

def main_cal(F_dict,F_set):
    output = 0
    for f in F_set:
        num = 1
        while F_dict[f] > 0:
            if F_dict[f] >= num:
                F_dict[f] -= num
                num += 1
            else:
                break
        output += (num-1)
    return output

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

    fa = fact(N)
    print(main_cal(fa[0],fa[1]))

if __name__ == "__main__":
    main()