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 SieveOfEratosthenes(n):
    sn = int(n ** 0.5)
    res = []
    check = [False] * (sn + 1)
    for i in range(2, sn+1):
        if check[i]:
            continue
        res.append(i)
        for j in range(2 * i, sn+1, i):
            check[j] = True
    return res

def trialDivision(n):
    res = dict()
    pn = SieveOfEratosthenes(n)
    for p in pn:
        while n % p == 0:
            res[p] = res.get(p, 0) + 1
            n //= p
    if n > 1:
        res[n] = 1
    return res

N = int(input())
fn = trialDivision(N)
ans = 0
for n in fn.values():
    res = 0
    s = 0
    for i in range(1, n+1):
        if s + i > n:
            break
        s += i
        res += 1
    ans += res

print(ans)

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

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

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

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

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

    return arr

arr = factorization(N)

min_nums = [1]
num_lists = [1]
num_dic = {1: 1}

ans = 0

for Z in arr:
    o = Z[1]
    for i, num in enumerate(num_lists):
        if num > o:
            ans += num_dic[num_lists[i-1]]
            break
    if num <= o:
        o = o - num
        _ans = len(min_nums)
        n = min_nums[-1]+1
        while o >= n:
            o -= n
            min_nums.append(n)
            _ans += 1
            num_lists.append(n+num_lists[-1])
            num_dic[num_lists[-1]] =  _ans
            n += 1
        ans += _ans

print(ans)

Solution (Python):
N = int(input())
a = []
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

prime_factorize(N, a)
ans = 0
if len(a) > 1:
    before = a[0]
    kosuu = 1
    for i in range(1, len(a)):
        tmp = a[i]
        if tmp == before:
            kosuu += 1
        else:
            ini = 1
            while kosuu - ini >= 0:
                kosuu = kosuu - ini
                ini += 1
                ans += 1
            before = tmp
            kosuu = 1
        ini = 1
    while kosuu - ini >= 0:
        kosuu = kosuu - ini
        ini += 1
        ans += 1
if len(a) == 1:
    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


fct=factorization(n)


cnt = 0
tmp = 0
ma = 0
for t in fct:
    if t[0] == 1:
        break
    
    tmp = t[1]
    ma = 1
    while tmp >= ma:
        tmp -= ma
        ma += 1
        cnt += 1


print(cnt)

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

ans = 0

for i in pf.items():
    m = i[1]

    a = 1
    cnt = 1

    while a <= m:
        cnt += 1
        a += cnt
    
    cnt -= 1

    ans += cnt

print(ans)

Solution (Python):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
   
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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)
le=len(a)
cnt=0
b=0
for i in range(le):
	b=1
	while a[i][1]>=b: 
		a[i][1]-=b
		b+=1
		cnt+=1

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

Solution (Python):
import collections

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

def tmp(m):
  c = 0
  s = 0
  for i in range(1,m+1):
    if s + i > m:
      return c
    c = c + 1
    s = s + i
  
  return c

def main():
  N = int(input())
  c = collections.Counter(prime_factorize(N))
  multupliyer_list = c.values()
  count = 0
  for m in multupliyer_list:
    t = tmp(m)
    count = count + t

  print(count)


if __name__ == "__main__":
  main()

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



c = collections.Counter(prime_factorize(n))
ans = 0
for i in c:
    nn = c[i]
    st = 1
    while nn>=st:
        nn=nn-st
        ans += 1
        st=st+1

print(ans)

Solution (Python):
import math

def factrize(x):
    f = {}
    if x == 1:
        return f
    tmp = x
    i = 2
    while i**2 <= tmp:
        cnt = 0
        while tmp % i == 0:
            cnt += 1
            tmp = tmp//i
        if cnt > 0:
            f[i] = cnt
        i += 1
    if tmp != 1 or f == {}:
        f[tmp] = 1
    return f
n = int(input())
m = factrize(n)
l = []
for i in m.values():
  l.append(i)
ans=[]
for i in l:
  for j in range(1, 40):
    if i - j >= 0:
      i -= j
      continue
    else:
      ans.append(j-1)
      break
print(sum(ans))

Solution (Python):
import sys

n = int(input())
ans = 0
if n == 1:
    print(0)
    sys.exit()
ma = int(n**(0.5))+1
for i in range(2,ma):
    j = 1
    k = 0
    while n%i == 0:
        k += 1
        n //= i
    else:
        while j <=k:
            ans += 1
            k -= j
            j += 1
if n != 1:
    ans += 1
print(ans)

Solution (Python):
from collections import *
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 = Counter(prime_factorize(int(input())))
count=0
for s in a.values():
    for m in range(40):
        if (m+1)*(m+2)/2>s:
            count+=m
            break
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


n = int(input())
B=[0]
for i in range(1,11):
    for j in range(i+1):
        B.append(i)

A=factorization(n)

ans=0
for i in A:
    ans+=B[i[1]]

if n==1:
    ans=0

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

d = collections.Counter(prime_factorize(n))

r = 0
for v in d.values():
    _v = v
    e = 1
    while _v > 0:
        _v -= e
        if _v >= 0:
            r += 1
        e += 1

print(r)

Solution (Python):
import sys
from collections import defaultdict, Counter, deque
from itertools import accumulate, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right, bisect
from heapq import heappop, heappush
from fractions import gcd
from math import ceil, floor, sqrt, cos, sin, pi
from copy import deepcopy




def divider(N):
    threshold = int(sqrt(N))
    res = defaultdict(int)
    for n in range(2,threshold+1):
        while N % n == 0:
            res[n] += 1
            N //= n
    if N > 1:
        res[N] += 1
    return res

def main():
    N = int(input())
    res = divider(N)
    
    ans = 0
    for k,v in res.items():
        i = 1
        while True:
            if v < i:
                break
            v -= i
            i += 1
            ans += 1
    print(ans)

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

def resolve():
    N = int(input())
    factor_list = prime_factorize(N)
    if len(factor_list) == 0:
        print(0)
        return
    factor_count = collections.Counter(factor_list)
    div_count = 0
    for factor, count in factor_count.items():
        e = 1
        while True:
            if count >= e:
                N = N // (factor**e)
                div_count += 1
                count -= e
                e += 1
            else:
                break
    print(div_count)

resolve()

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

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

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

    return arr

A = factorization(N)
c = 0
for i in range(len(A)):
    j = 2
    while True:
        f = j * (j - 1) / 2
        if A[i][1] < f:
            c += j - 2
            break
        j += 1
print(c)

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


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


def readint():
    return int(input())


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


def readstrs():
    return input().split()


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

    divisors.sort()
    return divisors


def is_prime(q, k=50):
    q = abs(q)
    
    if q == 2:
        return True
    if q < 2 or q & 1 == 0:
        return False

    
    d = (q - 1) >> 1
    while d & 1 == 0:
        d >>= 1

    
    for i in range(k):
        a = random.randint(1, q - 1)
        t = d
        y = pow(a, t, q)
        
        while t != q - 1 and y != 1 and y != q - 1:
            y = pow(y, 2, q)
            t <<= 1
        if y != q - 1 and t & 1 == 0:
            return False
    return True


def main():
    N = readint()
    if N == 1:
        print(0)
        exit()
    d = make_divisors(N)
    ans = 0
    
    p = [i for i in d if is_prime(i)]
    
    for i in range(1, 10):
        for z in [j ** i for j in p]:
            if z == 1:
                continue
            if not N % z:
                N //= z
                ans += 1

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
def check_prime(k):
    '''
    素数の時1、合成数の時0を返す
    '''
    if k == 1:return 0
    num = int(k ** 0.5 // 1)
    for i in range(2, num + 1):
        if k % i == 0:return 0
    return 1
n = int(input())
if n == 1:
    print(0)
    exit()

num = int(n ** 0.5 // 1)
check = []
for i in range(2, num + 2):
    if n % i == 0:
        cnt = 0
        while True:
            if n % i != 0:break
            n = n // i
            if n > num and check_prime(n):
                check.append([n, 1])
            cnt += 1
        check.append([i, cnt])
ans = 0

for num, cnt in check:

    temp = 1
    while True:
        
        if cnt >= temp:
            ans += 1
            cnt -= temp
            temp += 1
        else:break

print(ans if len(check) != 0 else 1)

Solution (Python):
from collections import Counter 
from collections import defaultdict
from collections import deque
from functools import reduce
import math
import itertools
import heapq
import numpy as np
import bisect
import sys

sys.setrecursionlimit(10**6)


def bfs(s,n,node):
    
    check=[False for _ in range(n)]
    check[s]=True
    
    queue=deque([s])
    visited_num=1

    
    
    color=[-1 for _ in range(n)]
    color[s]=0
    
    while visited_num<n:
        
        if len(queue)==0:
            
            
            return color

        now_vertex=queue.popleft()
        
        for next_vertex in node[now_vertex]:


            if check[next_vertex]==True:
                continue

            queue.append(next_vertex)
            check[next_vertex]=True

            
            color[next_vertex]=color[now_vertex]+1
            visited_num+=1

    return color




ceil=lambda x,y: (x+y-1)//y
input_list = lambda : list(map(int,input().split()))



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 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
div=make_divisors(n)

ind=0
ans=0
while(n!=1 and n>=div[ind]):
    ind+=1
    check=Counter(prime_factorize(div[ind]))
    if (len(check.keys()))>1:
        continue
    
    if n%div[ind]==0:
        ans+=1
        n=n//div[ind]

print(ans)

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

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

    divisors.sort()
    return divisors

def isit(N):

    A = make_divisors(N)
    A.pop(0)

    

    num = len(A)
    i=num-1

    for n in reversed(A):
        mul = False
        for m in A:
            if n%m == 0 and n!=m:
                mul = True
                break
        if mul == True:
            A.pop(i)
    
    
        i -= 1
    

    if len(A) == 1:
        return True
    else:
        return False

A =  make_divisors(N)
A.pop(0)

num = 0

for m in A:
    if isit(m) == True:
        if N%m == 0:
            N = N//m
            
            num += 1
        if N<m:
            break

print(num)

Solution (Python):
import sys
from itertools import accumulate
import math
import bisect


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

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

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

    return arr


def solve(n):
    if n == 1:
        return 0
    ans = 0
    acc = list(accumulate(list(range(int(math.log2(n) + 2)))))
    arr = factorization(n)
    for e in arr:
        ans += bisect.bisect_right(acc, e[1]) - 1
    return ans


def main():
    input = sys.stdin.buffer.readline
    n = int(input())

    print(solve(n))


if __name__ == '__main__':
    main()

Solution (Python):
def trial_division(n):
    if n < 2:
        return []

    prime_factors = []

    for i in range(2, int(n**0.5)+1):
        
        while n % i == 0:
            
            prime_factors.append(i)
            
            n //= i
    
    if n > 1:
        prime_factors.append(n)

    return prime_factors

n = int(input())
import collections
l = trial_division(n)
c = collections.Counter(l)

count = 0
for v in c.values():
  n = 1
  while v >= n*(n+1)/2:
    count += 1
    n +=1
    
print(count)

Solution (Python):
def era(num):
    input_list = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(num)]
    input_list[0] = input_list[1] = False
    input_list[2] = input_list[3] = input_list[5] = True
    sqrt = num**0.5

    for serial in range(3, num, 2):

        if serial >= sqrt:
            return input_list

        for s in range(serial ** 2, num, serial): 
            input_list[s] = False

N=int(input())
if N<25:
    Prime=[2,3,5]
else:
    input_list=era(int(N**0.5)+1)
    Prime=[i for i, b in enumerate(input_list) if b == True]

Fac={}
for p in Prime:
    while N%p==0:
        N//=p
        if p in Fac:
            Fac[p]+=1
        else:
            Fac[p]=1
    if N==1:
        break
if N!=1:
    Fac[N]=1
ans=0

for k in Fac:
    nec=1
    while True:
        if Fac[k]>=nec:
            ans+=1
            Fac[k]-=nec
            nec+=1
        else:
            break

print(ans)

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

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

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

    return arr

import sys
N = int(input())
count = 0
if N == 1:
    print(count)
    sys.exit()

for i in factorization(N):
    a = 1
    while i[1] >= a*(a+1)/2:
        a += 1
        count += 1
        
print(count)

Solution (Python):
import math


def is_prime(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 make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors


N = int(input())
divisors = make_divisors(N)

cnt = 0
for d in divisors:
    if d == 1:
        continue

    if N < d:
        break

    if is_prime(d):
        dd = d
        while True:
            if N < dd:
                break
            if N % dd == 0:
                N //= dd
                cnt += 1
                dd *= d
            else:
                break
print(cnt)

Solution (Python):
import sys
from math import factorial
from collections import Counter
from fractions import Fraction
import heapq, bisect, fractions
import math
import itertools
sys.setrecursionlimit(10 ** 5 + 10)
INF = 10**15 +5
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
MOD = 10**9 + 7


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()
counter = list(dict(Counter(prime_factorize(n))).values())

res = 0
for ele in counter:
    res += int(math.sqrt(2*ele+0.25)-0.5)
print(res)

Solution (Python):
import math

n = int(input())

factors = []

m2 = 0
while n > 1 and n % 2 == 0:
	m2 += 1
	n //= 2
if m2:
	factors.append((2,m2))

m3 = 0
while n > 1 and n % 3 == 0:
	m3 += 1
	n //= 3
if m3:
	factors.append((3,m3))

i = 5
l = int(math.sqrt(n)) + 1

while n > 1 and i < l:
	if n % i == 0:
		m = 0
		while n > 1 and n%i == 0:
			m += 1
			n //= i
		factors.append((i, m))
	i += 2

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

ans = 0

for _, m in factors:
	count = 0
	s = 0
	while s < m:
		count += 1
		s += count
	ans += count if s == m else count - 1

print(ans)

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

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

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

    return arr

N = int(input())


ans = factorization(N)

if ans == [[1,1]]:
    print(0)
else:
    sum = 0
    for i in range(len(ans)):
        n = 1
        while ans[i][1] >= n:
            ans[i][1] -= n
            sum += 1
            n += 1
    print(sum)

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())
count = 0
primelist = factorization(n)


if primelist[0][0]==1:
  print(0)
else:
  for i in range(len(primelist)):
    for j in range(40):
      if j*(j+1)/2 > primelist[i][1]:
        count += (j-1)
        break
  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

N = int(input())
used = list()
count = 0
while N > 1:
    operated = False
    factor = factorization(N)
    candidate = list()
    for f in factor:
        base = f[0]
        for e in range(1, f[1]+1):
            candidate.append(pow(base, e))
    candidate.sort()

    for z in candidate:
        if z in used or N % z != 0:
            continue
        count += 1
        operated = True
        used.append(z)
        N //= z

    if not operated:
        break

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


N=int(input())

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

A=factorization(N)
ans=0
for a in A:
    n=a[1]
    i=1
    while n-i>=0 :
        ans+=1
        n-=i
        i+=1
print(ans)

Solution (Python):
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

N = ri()

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

divs = get_divisors(N)

ans = 0
for p, c in divs:
	i = 1
	while c >= i:
		c -= i
		ans += 1
		i += 1

print(ans)

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

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

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

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

    return arr

l = factorization(x)
l = sorted(l)
ans = 0
for i in range(len(l)):
  if l[i][0] == 1:
    continue
  else:
    s = 0
    num = l[i][1]
    if num == 1:
      j = 1
    else:
      for j in range(1, num):
        s += j
        if s == num:
          break
        elif s > num:
          j -= 1
          break
    ans += j
    
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
  
A=0
z=1
q=factorization(N)
if N==1:
    print(0)
else:  
    for i in range(len(q)):
        for j in range(1,101):
            z=q[i][0]**j
            if N%z==0:
                A+=1
                N=N/z
            else:
                break
    print(A)

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

temp_list = c.values()
ans = 0

if n == 1:
    print(0)
else:
    for i in temp_list:
        temp_num = i
        temp = 1
        while temp_num >= temp:
            temp_num = temp_num - temp
            ans += 1
            temp += 1
    print(ans)

Solution (Python):
n=int(input())
ans=0
dp=[1,1]+[0 for _ in range(int(n**0.5)-1)]

if n == 1:
  print("0")
  exit()
for i in range(2,int(n**0.5)+1):
  if dp[i] == 1:
    continue
  A,j=0,1
  while n % i == 0:
    n //= i
    A += 1    
  while j*(j+1)//2 <= A:
    ans += 1
    j += 1
  for k in range(i,int(n**0.5)+1,i):
    dp[k] = 1

if n != 1:
  ans += 1
print(ans)

Solution (Python):
import sys
import math
from collections import defaultdict
def input(): return sys.stdin.readline().rstrip()

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

    ans = 0
    MAX_N = math.ceil(math.sqrt(N)) + 1

    div = defaultdict(int)
    for i in range(2, MAX_N):
        while N % i == 0:
            N //= i
            div[i] += 1
            if N == 1:
                break
    for i, v in div.items():
        key = 1
        while True:
            v -= key
            ans += 1
            if v <= key:
                break
            key += 1

    if N > 1:
        ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
def main():
    import copy
    n = int(input())
    if n==1:
        print(0)
        return
    k = copy.deepcopy(int(n**0.5)+2)
    ans = 0
    for i in range(2,k):
        if n%i==0:
            m = 1
            ans += 1
            n = n//i
            cnt = 0
            while n%i==0:
                n = n//i
                cnt += 1
                if cnt > m:
                    m = m+1
                    cnt = 0
                    ans += 1
        if n==1:
            break
    if ans==0:
        print(1)
        return
    if n!=1:
        print(ans+1)
        return
    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
if n == 1:
    print(0)
    exit()
    
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(cnt)

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

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

    return arr

l = [0] + [1]*2+[2]*3+[3]*4+[4]*5+[5]*6+[6]*7+[7]*8+[8]*9+[9]*10
ls = fact(n)
ans = 0
for v in ls:
    ans += l[v]
print(ans)

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

    return arr

n = int(input())
if n == 1:
    print(0)
else:
    ans = 0
    c = factorization(n)
    for arr in c:
        m = arr[1]
        i = 1
        for _ in range(m):
            if i > m:
                break
            ans += 1
            m -= i
            i += 1
    print(ans)

Solution (Python):
from bisect import bisect_right
import sys

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


S = [0]
now = 0
for i in range(1, 60):
    S.append(i * (i + 1) // 2)


fact_list = factorization(N)


if fact_list == [[1, 1]]:
    print(0)
    sys.exit()
ans = 0
while fact_list:
    now_fact = fact_list.pop()
    idx = bisect_right(S, now_fact[1])
    ans += idx - 1

print(ans)