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

Solution (Python):
import sys

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(sys.stdin.readline().strip())

decomposed = factorization(N)


if decomposed == [[1, 1]]:
	print(0)
	sys.exit()

ans = 0
for factor, count in decomposed:
	for i in range(10000):
		if count < i*(i+1) // 2:
			ans += i-1
			break

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

yakusu = factorization(n)

ans = 0

for i in range(len(yakusu)):
    l = yakusu[i]
    a,b = l[0],l[1]
    j = 1
    k = 2
    if a != 1:
        while b>=j:
            ans += 1
            j += k
            k += 1
if n==1:
    print(0)
else:
    print(max(ans,1))

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)

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

N = int(input())
fact = factorization(N)
ans = 0

for i in fact:
    if i == -1: break
    tmp = i
    for j in range(1, i+1):
        if tmp >= j:
            tmp -= j
            ans += 1
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

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

    l = factorization(n)



    if all(l[i][1] == 1 for i in range(len(l))):
        ans = len(l)
    else:
        ans = 0
        for i in range(len(l)):
            if l[i][1] == 1:
                ans += 1
            else:
                ans += int(( -1 + math.sqrt(1 + 8 * l[i][1]) ) / 2)
    print(ans)

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

def prime_factors(n):
    i = 2
    factors = []
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            factors.append(i)
    if n > 1:
        factors.append(n)
    return factors

f = prime_factors(N)
f_dict = defaultdict(int)
for i in f:
    f_dict[i] += 1

def triangle_map(m):
    
    i = 1
    while i*(i+1) <= 2*m:
        i += 1
    return i-1

ans = 0
for i in f_dict:
    ans += triangle_map(f_dict[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



def tori(A):
    cn=A
    k=1
    while cn>0:
        k+=1
        cn-=k
    return k-1

bunkai=factorization(N)

result=0
if N==1:
    print(0)
else:
    for j in range(len(bunkai)):
        result+=tori(bunkai[j][1])
    print(result)

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

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

count = 0

if n == 1:
  print(0)
else:
  for i in range(len(arr)):
    temp = 1
    temp2 = arr[i][1]
    while temp2 > 0:
      count += 1
      temp += 1
      temp2 -= temp
  print(count)

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

if N == 1:
    print(0)
    sys.exit(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


T = prime_factorize(N)


q = defaultdict(int)
p = set(T)

for t in T:
    q[t] += 1

ans = 0

for pp in list(p):
    count = 0
    tmp = 0
    while True:
        tmp += 1
        count += tmp + 1
        if count >= q[pp]:
            break
    ans += tmp

print(ans)

Solution (Python):
def fa(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()
A=fa(n)
ans=0
for i in range(len(A)):
  x=int((2*A[i][1])**(0.5))
  if (x-2)*(x-1)<=2*A[i][1]<x*(x-1):
    a=x-2
  if (x-1)*x<=2*A[i][1]<x*(x+1):
    a=x-1
  if (x+1)*x<=2*A[i][1]<(x+2)*(x+1):
    a=x
  if (x+1)*(x+2)<=2*A[i][1]<(x+2)*(x+3):
    a=x+1
  if (x+3)*(x+2)<=2*A[i][1]<(x+4)*(x+3):
    a=x+2
  ans=ans+a
print(ans)

Solution (Python):
import math
def solve():
    N = int(input())
    divisors = calc_divisors(N)
    divisors.sort()

    now = N
    i = 1
    ans = 0
    while i != len(divisors):
        if isPrime(divisors[i]) and now % divisors[i] == 0:
            now /= divisors[i]
            ans += 1
        else:
            if len(set(prime_factorize(divisors[i]))) == 1 and now % divisors[i] == 0:
                now /= divisors[i]
                ans += 1
        i += 1
    
    print(ans)

def isPrime(n):
    if n == 1: return False

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

    return True

def sieve(n):
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False

    p = 0
    for i in range(2,n+1):
        if is_prime[i]:
            p = i
            for j in range(p+p, n+1, p):
                is_prime[j] = False
        
        if p * p > n:
            break
    
    primes = []
    for i in range(2,n+1):
        if is_prime[i]:
            primes.append(i)

    return primes

def prime_factorize(n):
    prime_numbers = []
    for p in range(2, int(math.sqrt(n)+1)):
        if n % p != 0:
            continue
        while n % p == 0:
            n /= p
            prime_numbers.append(p)

    if n != 1:
        prime_numbers.append(n)
    return prime_numbers

def calc_divisors(n):
    divisors = []
    for i in range(1,int(math.sqrt(n)+1)):
        if n % i == 0:
            divisors.append(i)
            if (i*i != n):
                divisors.append(n//i)

    return divisors
if __name__ == '__main__':
    solve()

Solution (Python):



import sys
sys.setrecursionlimit(10**7)
from pprint import pprint as pp
from pprint import pformat as pf



import math
from collections import defaultdict

import bisect



def survey():
    v = 1
    k = 2
    i = 0
    while not (v > 10 ** 12):
        v = k ** i
        print(i)
        i += 1

def survey2():
    v = 1
    s = 0
    while not (s > 50):
        
        s += v
        v += 1

def diff_selectable(v):
    l = [1, 3, 6, 10, 15, 21, 28, 36, 45, ]
    for i, t in enumerate(l):
        if v < t:
            return i
    raise ValueError

"""
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 prime_factorize(n):
    a = defaultdict(lambda: 0)
    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

if __name__ == '__main__':
    ans = 0
    data = int(input())
    primes = prime_factorize(data)
    for pc in primes.values():
        ans  += diff_selectable(pc)
    
    print(ans)

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
det = []
if N ==1:
    ans = 0
else:
    for (i, j) in factorization(N):
        max_x = pow(i, j)
        
        v = i
        temp = 1
        for k in range(j):
            x = pow(v, k+1)
            
            if x not in det and temp*x <= max_x:
                temp *= x
                ans += 1
                det.append(x)
    
print(ans)

Solution (Python):
from math import gcd
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
n = int(input())
if n == 1:
    print(0)
    exit()
l = prime_factorization(n)
cnt = 0
for i in l:
    for j in range(1,i[1]+1):
        if n >= i[0]**j and n % i[0]**j == 0:
            n//=i[0]**j
            cnt+= 1
print(cnt)

Solution (Python):
def prime(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 list(set(a))
x=int(input())
p=prime(x)
s=0

for j in p:
    i=1
    while x%(j**i)==0:
        x=x//(j**i)
        s+=1
        i+=1
print(s)

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

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
import bisect
import numpy as np
import math
from collections import deque
from collections import defaultdict
from math import gcd

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

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

    ans = 0
    for p, r in fact:
        index = 0
        cum_sum = 1
        cnt = 1
        while cum_sum <= r:
            index += 1
            cum_sum += cnt + 1
            cnt += 1

        ans += index
    print(ans)

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")


def solve():
    n = II()
    ans = 0
    N = int(sqrt(n))+2
    d = defaultdict(int)
    d[1] = 1 
    for i in range(2, int(sqrt(n - 1)) + 2):
        if d[i] == 0:
            x = i
            while 1:
                if n % x == 0 and d[x] != 1:
                    ans += 1
                    n //= x
                    d[x] = 1
                else:
                    break
                x *= i
            l = i
            j = 1
            while l < N:
                d[l] = 1
                j += 1
                l = i * j
    if d[n]:
        print(ans)
    else:
        print(ans + 1)
    return



if __name__ == '__main__':
    solve()

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

exp = []

cnt = 0
while n%2 == 0:
    cnt += 1
    n //= 2
if cnt > 0:
    exp.append(cnt)

i = 3
while i*i <= n:
    cnt = 0
    while n%i == 0:
        cnt += 1
        n //= i
    exp.append(cnt)
    i += 2

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

opr = 0
for x in exp:
    opr += int((-1+(8*x+1)**(1/2))/2)

print(opr)

Solution (Python):
n = int(input())
i = 2
ans = 0
while True:
  if i * i > n:
    break
  if n % i == 0:
    cnt = 0
    while n % i == 0:
      n /= i
      cnt += 1
    k = 1
    while cnt >= k:
      cnt -= k
      k += 1
    ans += k - 1
  i += 1
if n > 1:
  ans += 1
print(ans)

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

def calc(n):
    ret = 0
    for i in range(1, 1000):
        n -= i
        if n == 0:
            ret = i
            break
        elif n < 0:
            ret = i-1
            break
    return ret

N = int(input().rstrip())
d = {}
for x in prime_factorize(N):
    if x not in d.keys():
        d[x] = 1
    else:
        d[x] += 1
ret = 0
for x in d.values():
    ret += calc(x)
print(ret)

Solution (Python):
N = int(input())
pf={}
m=N
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
X = list(pf.values())
ans = 0
for i in X:
    temp = 1
    while i>=temp:
        i -= temp
        temp += 1
        ans += 1
print(ans)

Solution (Python):
import itertools

def factorize(n):
    """素因数分解を行う

    Args:
        n (int): 素因数分解したい数

    Returns:
        fct (list[int]): 素因数分解した結果

    Examples:
        >>> factorize(1000)
        [2, 2, 2, 5, 5, 5]
    """
    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 resolve():
    N = int(input())

    ans = 0
    factorize_N = factorize(N)

    if len(factorize_N) == 0:
        print(0)
        return

    for key, value in itertools.groupby(factorize_N):
        tmp = len(list(value))
        for i in range(1, tmp + 1):
            tmp -= i
            if (tmp < 0):
                break
            ans += 1

    print(ans)

resolve()

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

A=factorization(N)
P=[row[1] for row in A]
if A[0][0]==1:
    print(0)
    exit()

ans=0

for i in range(len(P)):
    c=1
    while P[i]>=c:
        P[i]-=c
        c+=1
        ans+=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

n = int(input())
p = prime_factorize(n)
c = Counter(p)
ans = 0
for i in c.keys():
    ans += 1
    x = c[i]
    y = 3
    i = 3
    if x > 2:
        while True:
            if x < y:
                break
            else:
                ans += 1
                y += i
                i += 1
print(ans)

Solution (Python):
from bisect import bisect_right
from collections import defaultdict
import numpy as np


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

primes = factorization(N)

A = np.arange(1, 100)
cumsum_A = A.cumsum()


if len(primes) == 0:
    print(1)
    exit()

ans = 0
for _, value in primes:
    idx = bisect_right(cumsum_A, value)
    ans += idx
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())
n_fact = factorization(n)
ans=0
for i in n_fact:
    a = i[1]
    cnt=0
    while a > cnt:
        cnt += 1
        a -= cnt
        ans += 1
if n == 1:
    ans = 0
print(ans)

Solution (Python):
N = int(input())
if N == 1:
    print("0")
    exit()
def f(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

temp = f(N)
ans = 0
for x in temp:
    i = 0
    temp2 = x[1]
    while(temp2 > 0):
        i += 1
        temp2 -= i
        if temp2 >= 0:
            ans += 1

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())
total = 0
if n == 1:
    print("0", end="")
    exit()

ps = factorization(n)
for p in ps:
    c = int((-1 + math.sqrt(1+8*p[1]))/2)
    total += c
print(total, end="")

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

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

aoinsu = factorize(n)

kaijo = [1]
b = 1
for i in range(2,10):
    b = b+i
    kaijo.append(b)





ans = 0
for i in range(len(aoinsu)):
    a = aoinsu[i][1]
    for j in range(10):
        if a < kaijo[j]:
            ans += j
            break


print(ans)

Solution (Python):
import sys
input = sys.stdin.readline

n = int(input())

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

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

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

    return arr

m = 0

if n == 1:
    print(0)
else:
    for i in factorization(n):
        sankaku = (int((1+8*i[1])**0.5)-1) // 2
        m += sankaku   
    print(m)

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

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

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

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

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

    return arr
  
list = fac(n)
count = 0
for l in list:
  c = 0
  sum = 0
  while True:
    c += 1
    sum += c
    if l[1]<sum:
      break
    count += 1

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

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))
c = list(c.items())
ans = 0
for i in range(len(c)):
    d= c[i][1]
    t=1
    while d>0:
        d -= t
        t += 1
        if d>=0:
            ans +=1

print(ans)

Solution (Python):

import sys

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

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

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

    return arr

n = int(input())

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

ans = factorization(n)

def f(v):
    i = 1
    s = 0
    while s < v:
        i += 1
        s += i
    return i - 1

print(sum([ f(v) for k,v in ans]))

Solution (Python):
from collections import defaultdict

N = int(input())
if N == 1:
    print(0)
    exit()
index = int(pow(N, 0.5) + 1)
ans = []
for i in range(2, index):
    while N % i == 0:
        N //= i
        ans.append(i)

if N != 1:
    ans.append(N)
if ans == []:
    print(1)
    exit()
d = defaultdict(int)
for i in ans:
    d[i] += 1
sosuLst = []
for v, c in d.items():
    cnt = 1
    while c > 0:
        c -= cnt
        cnt += 1
        if c != 0 and c < cnt:
            sosuLst.append(v ** cnt)
            break
        else:
            sosuLst.append(v ** (cnt - 1))

print(len(set(sosuLst)))

Solution (Python):
def factorization(n):
    if n==1:
        return []
    arr = []
    temp = n
    cand = [2]+list(range(3, int(-(-n**0.5//1))+1, 2))
    for i in cand:
        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

max_N=1000
s = [i for i in range(1, max_N)]
sums = [sum(s[:i]) for i in range(1,max_N)]
def comb(a):
    for i in range(max_N):
        if a<sums[i]:
            return i

N = int(input())
fac = factorization(N) 
res = 0
for a in [el[1] for el in fac]:
    res += comb(a)
print(res)

Solution (Python):
import collections

def pf(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=int(input())
pl=pf(a)
c=collections.Counter(pl)
nl=list(c.values())

re=0
for x in nl:
  for y in range(1,100):
    if x*2<(y+1)*(y+2):
      re+=y
      break
      
print(re)

Solution (Python):
import bisect
import collections
import math
N = int(input())

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


def trial_division(n):
    
    factor = []
    
    tmp = int(math.sqrt(n)) + 1
    for num in range(2, tmp):
        while n % num == 0:
            n //= num
            factor.append(num)
    
    if not factor:
        return [n]
    else:
        if n != 1:
            factor.append(n)
        return factor


C = collections.Counter(trial_division(N))


L = [1]
for i in range(2, 1000):
    L.append(L[-1]+i)



ans = 0
for V in C.values():
    ans += bisect.bisect_right(L, V)
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
A = collections.Counter(prime_factorize(N))
ans = 0
for i in A.values():
  for j in range(40):
    if ((j + 1) * (j + 2) / 2 <= i) and ((j + 2) * (j + 3) / 2 > i):
      ans = ans + j + 1
print(ans)

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


def make_divisors(n):
    lower_divisors, upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]


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


yakusu_list = make_divisors(n)
ans_list = []

ans = 0
for r in yakusu_list:
    if r == 1:
        continue
    if len(factorization(r)) == 1 and n % r == 0:
        n //= r
        ans += 1
        ans_list.append(r)
    if n == 1:
        break

print(ans)

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

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

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

    return arr
ans=0  
if N==1:
  print(0)
else:
  for i in range(len(fact(N))):
    j=1
    while fact(N)[i][1]>=j*(j+1)/2:
      j+=1
    ans+=(j-1)
  print(ans)

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

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

tmp = n
ans = 0
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
        i_cnt = int((cnt*2)**0.5//1)
        if i_cnt * (i_cnt+1) //2 <= cnt and (i_cnt+1) * (i_cnt+2) //2 > cnt:
            ans += i_cnt
        elif (i_cnt-1) * i_cnt //2 <= cnt and i_cnt * (i_cnt+1) //2 > cnt:
            ans += i_cnt - 1

if tmp != 1:
    ans += 1

print(ans)

Solution (Python):

import collections

def factorize(target_number):
    factor = 2
    factor_list = []
    while factor * factor <= target_number:
        while target_number % factor == 0:
            target_number //= factor
            factor_list.append(factor)
        factor = factor + 1
    if target_number > 1:
        factor_list.append(target_number)
    return factor_list

N = int(input())

fact_list = factorize(N)

fact_counter_dict = collections.Counter(fact_list)
ans = 0
for fact, freq in fact_counter_dict.items():
    freq_copy = freq
    for i in range(1, freq + 1):
        freq_copy -= i
        if freq_copy < 0:
            break
        ans += 1
print(ans)

Solution (Python):
n = int(input())
N=n
p=2
d={}
ans=0
while(1):
    while(n%p==0):
        n//=p
        if d.get(p)==None:
            d[p]=1
        else:
            d[p]+=1
    if p**2>=N:
        if n!=1:
            d[n]=1
        break
    p+=1
for k,v in d.items():
    i=1
    while(1):
        v-=i
        if v>=0:
            ans+=1
            i+=1
        else:
            break
if (ans==0) and (N>1):
    print(1)
else:
    print(ans)

Solution (Python):
def factorization(n):
    ans = 0
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            tmp = set()
            while temp%i==0:
                cnt+=1
                temp //= i
                if not cnt in tmp:
                    tmp.add(cnt)
                    cnt = 0
                    ans += 1

    if temp!=1:
        ans += 1

    if ans==0 and temp!=1:
        ans += 1

    return ans

N = int(input())
print(factorization(N))

Solution (Python):
n=int(input())
if n==1: print(0); exit()
M=10**6+1
l=[]
p=[1]*M
p[0]=p[1]=0
for i in range(2,M):
  if p[i]:
    l.append(i)
    for j in range(2*i,M,i):
      p[j]=0
d={}
for k in l:
  c=0
  while n%k==0: n//=k; c+=1
  if c>0: d[k]=c
s=[1]
for i in range(2,9):
  s.append(s[-1]+i)
a=0
for i in d.values():
  for j in s:
    if j>i: break
    a+=1
print(a+(n>1))