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):
from collections import Counter

N = int(input())

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

ans = 0
n = 1
for i, v in Counter(prime_factorize(N)).items():
    
    while True:
        
        v -= n
        if v >= 0:
            ans += 1
            n += 1
        else:
            break
    n = 1
print(ans)

Solution (Python):
from math import sqrt
from sys import stdin, stdout

int_in = lambda: int(stdin.readline())
arr_in = lambda: [int(x) for x in stdin.readline().split()]
mat_in = lambda rows: [arr_in() for y in range(rows)]
str_in = lambda: stdin.readline().strip()
out = lambda o: stdout.write("{}\n".format(o))
arr_out = lambda o: out(" ".join(map(str, o)))
bool_out = lambda o: out("YES" if o else "NO")
tests = lambda: range(1, int_in() + 1)
case_out = lambda i, o: out("Case 


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

def solve(n):
    primes = sorted(prime_factors(n))
    used = set()
    result = 0
    i = 0
    while n > 1 and i < len(primes):
        curr = primes[i]
        while curr in used:
            i += 1
            if i == len(primes):
                return result
            if primes[i - 1] != primes[i]:
                curr = primes[i]
            else:
                curr *= primes[i]
        n //= curr
        used.add(curr)
        result += 1
        i += 1
    return result

if __name__ == "__main__":
    n = int_in()
    out(solve(n))

Solution (Python):
def solve(n):
    l = []
    k = int(n**0.5)
    i = 2
    tmp = 0
    while i <= n and i <= k:
        if n % i == 0:
            n = n // i
            tmp += 1
        else:
            if tmp != 0:
                l.append(tmp)
                tmp = 0
            i += 1
    if n == 1:
        l.append(tmp)
    else:
        l.append(1)
    res = 0
    for z in l:
        i = 1
        z -= i
        while z >= 0:
            res += 1
            i += 1
            z -= i
    return res





if __name__ == '__main__':
    n = int(input())
    print(solve(n))

Solution (Python):
import sys
from functools import lru_cache


@lru_cache(maxsize=None)
def solve(n):
    ans = 0
    for i in range(1, 10*10):
        if n - i >= 0:
            ans += 1
            n -= i
        else:
            return(ans)


n = int(input())


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


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 = list(pf.values())
ans = sum([solve(x) for x in ans])

print(ans)

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

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 a
ans = prime(N)
c = collections.Counter(ans)
count = 0
for i in c.keys():
  if c[i] <= 2:
    count += 1
  elif c[i] <= 5:
    count += 2
  elif c[i] <= 9:
    count += 3
  elif c[i] <= 14:
    count += 4
  elif c[i] <= 20:
    count += 5
  elif c[i] <= 27:
    count += 6
  elif c[i] <= 35:
    count += 7
  elif c[i] <= 44:
    count += 8

print(count)

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

import collections

N = int(input())
A = collections.Counter(prime_factorize(N))

ans = 0
for a in A.values():
	b = 1
	c = 1
	while True:
		if b > a:
			break
		c+=1
		b = b + c
	ans+=c-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

def main():
    c = prime_factorize(N)
    if c == []:
        print(0)
        return
    else:
        coll = collections.Counter(c).values()
        ans = 0
        for i in coll:
            tmp = 0
            while i > 0:
                if(tmp < i):
                    ans += 1
                    tmp += 1
                    i -= tmp
                else:
                    break
        print(ans)
        return

if __name__ == "__main__":
    main()

Solution (Python):
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left
from functools import reduce

def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7

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

def main():
    n = i_input()

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

    tmp = prime_factorize(n)

    if len(tmp) == 1:
        print(1)
        exit()

    count = 0

    counter_tmp = Counter(tmp)

    a_list = []

    for k, v in counter_tmp.items():
        while v >= 1:
            a_list.append(k**v)
            v -= 1

    a_list.sort()

    for a in a_list:
        if n % a != 0:
            continue
        n /= a

        count += 1

    print(count)

if __name__ == '__main__':
    main()

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

n = int(input())
a = sorted(divisor(n))
cnt = 0
for i in range(1, len(a)):
    b = prime_decomposition(a[i])
    if len(list(set(b))) == 1:
        if n % a[i] == 0:
            n //= a[i]
            cnt += 1
print(cnt)

Solution (Python):

def prime_factorization(number):
    n = number
    i = 2
    factor = {}
    while i * i <= n:
        while n % i == 0:
            if i in factor:
                factor[i] += 1
            else:
                factor.update({i : 1})
            n //= i
        i += 1
    if n > 1 or not factor:
        if n in factor:
            factor[n] += 1
        else:
            factor.update({n : 1})
    return factor

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

    if n == 1:
        print(0)
        return

    prime_factor = prime_factorization(n)
    p = len(prime_factor)
    prime_count = [0 for _ in range(p)]
    for i, x in enumerate(prime_factor.items()):
        prime_count[i] = x[1]

    ans = 0
    for i in range(p):
        need = 1
        while prime_count[i] >= need:
            prime_count[i] -= need
            ans += 1
            need += 1

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
from collections import deque
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)
    a.sort()
    return a

q = deque()
prime = prime_factorize(N)
for x in prime:
  q.append(x)


count = 0
done = []
while N != 1:
  break_flag = False
  if len(q) == 0:
    break
  x = q.popleft()
  
  if x == 1:
    continue
  
  if x in done:
    mul = x
    while mul in done:
      if len(q) == 0:
        break_flag = True
        break
      pop = q.popleft()
      
      if x != pop:
        
        q.appendleft(pop)
        
        break_flag = True
        break
      mul *= pop
    x = mul
    if break_flag:
      continue
  
  if N % x == 0:
    N = N // x
    count += 1
    done.append(x)

print(count)

Solution (Python):
import collections
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 = collections.Counter(a)
l = list(c.values())

def func(n):
    i = 2
    counter = 1
    while counter <= n:
        counter += i
        i += 1
    return i-2

print(sum(map(func, l)))

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 cnt(arr):
    c = 0
    n = arr[1]
    i = 1
    while True:
        if 0 <= n - i:
            c += 1
            n -= i
            i += 1
        else:
            break

    return c

arr = factorization(n)

ans = 0
if n != 1:
    for i in arr:
        ans += cnt(i)

print(ans)

Solution (Python):
def fanction(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())
    z_list=[]
    arr = fanction(N)
    k=0
    for i in range(len(arr)):
        p=arr[i][1]
        for j in range(1,arr[i][1]+1):
            if p>=j:
                z = arr[i][0]
                z_list.append(z)
                k+=1
                p-=j
    if N==1:
        k=0
    print(k)

main()

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

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

import collections
c = collections.Counter(prime_factorize(n))

ret = 0
for k, num in c.items():
    cnt = 1
    while True:
        num -= cnt
        if num >= 0:
            ret += 1
        else:
            break
        cnt += 1

print(ret)

Solution (Python):
import math

n = int(input())


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


primes = prime_factorize(n)

d = {}
for p in primes:
    if p in d:
        d[p] += 1
    else:
        d[p] = 1

ans = 0
for k, v in d.items():
    wp = 2
    d[k] -= 1
    ans += 1
    if wp == 2 and d[k] == 1:
        d[k] = 0
        continue
    while d[k] != 0:
        if wp * 2 + 1 <= d[k]:
            d[k] -= wp
            wp += 1
            ans += 1
        else:
            d[k] = 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())
ans=0
insu=factorization(n)

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

Solution (Python):
import math
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
def ff(x):
    temp=(-1+math.sqrt(1+8*x))/2
    return int(temp)
s=0
x=factorize(n)
for i in x:
    s+=ff(i[1])
    
    
if(n==1):
    print(0)
else:
    print(s)

Solution (Python):
from collections import defaultdict
def prime_factorization(n):
  if n==1:
    return {}
  res=defaultdict(int)
  for f in range(2,n):
    if f*f>n:
      break
    while n%f==0:
      n=n//f
      res[f]+=1
  if n>1:
    res[n]+=1
  return res

def cnt_ope(n):
  return min(k for k in range(n+1) if (k+2)*(k+1)//2>n)

def main():
  fac=prime_factorization(int(input()))
  return sum(cnt_ope(cnt) for cnt in fac.values())
print(main())

Solution (Python):
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

def f(x):
    N = 2
    while 1:
        A = N * (N + 1) / 2
        if x < A:
            return N - 1
        N += 1

N = int(input())

div = pf(N)
exp = []

begin =-1
for i in range(len(div)):
    A = div[i]

    if i == len(div) - 1:
        exp.append(i - begin)
        break

    if div[i + 1] != A:
        exp.append(i - begin)
        begin = i

ans = 0

for i in exp:
    ans += f(i)

print(ans)

Solution (Python):
import collections
import math
from statistics import mode
N = int(input())
c = 0
ans = 0
def prime_factorize(n):
	a = []
	while n % 2 == 0:
		a.append(2)
		n //= 2
	f = 3
	while f * f <= n:
		if n % f == 0:
			a.append(f)
			n //= f
		else:
			f += 2
	if n != 1:
		a.append(n)
	return a
e = []
for i in set(prime_factorize(N)):
	e.append(prime_factorize(N).count(i))

for i in e:
	for j in range(math.ceil(math.sqrt(2*i))+1):
		if (j+1)*(j+2)//2 > i:
			break
		c += 1
	ans += c
	c = 0
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
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
if is_prime(N):
    print(1)
elif N == 1:
    print(0)
else:
    insu = factorization(N)
    ans = 0
    for i,j in insu:
        p = 1
        while True:
            j -= p
            if j >= 0:
                N = N // (i**p)
                ans += 1
            else:
                break
            p += 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())

L = []
L = factorization(n)
c = 0

if L[0][0] != 1:
    for i in range(len(L)):
        a = 1
        while L[i][1]>=a:
            L[i][1] = L[i][1]-a
            a += 1
            c += 1

print(c)

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

def saidai(n):
    ans = int(math.sqrt(2 * n)) - 1
    while 2 * n >= (ans + 1) * (ans + 2):
        ans += 1
    return(ans)

N = int(input())
fac = factorization(N)
index = []
for i in fac:
    index.append(i[1])
ans = 0
for i in index:
    ans += saidai(i)
if N == 1:
    print(0)
else:
    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


import collections

N = int(input())
c = collections.Counter(prime_factorize(N))
ans = 0

for p, n in c.items():
    for i in range(1, 10000000):
        if n < i:
            break
        ans += 1
        n -= i

print(ans)

Solution (Python):
from heapq import *
import sys
from collections import *
from itertools import *
from decimal import *
import copy
from bisect import *
import math
sys.setrecursionlimit(4100000)
def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b))
input=lambda :sys.stdin.readline().rstrip()
N=int(input())


lst=defaultdict(int)
lst2=[]
lst3=[]
for i in range(2,int(N**.5)+100):
    if N%i==0:
        lst2.append(i)
        lst3.append(N//i)
lst3.reverse()
lst2+=lst3

for i in lst2+[N]:
    while N>1 and N%i==0:
        N//=i
        lst[i]+=1
c=0

for s in lst:
    l=lst[s]
    i=1
    while l>=i:
        l-=i
        c+=1
        i+=1
print(c)

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
x = factorize(N)
counter = 0
for item in x:
  if item[1]==1:
    counter += 1
  else:
    temp = item[1]
    i = 1
    while temp > 0:
      temp -= i
      i += 1
      if temp >= 0:
        counter += 1
print(counter)

Solution (Python):
from math import sqrt
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 hoge(c):
    return int((-1+sqrt(1+8*c))/2)
n = int(input())
a = prime_factorize(n)
b = set(a)
print(sum([hoge(a.count(e)) for e in b]))

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

N = int(input())
insu = prime_factorize(N)

insu_num = []
ans = 0

while len(insu) != 0:
    num = insu.count(insu[0])
    insu_num.append(num)
    insu = insu[num:]

for num in insu_num:
    p = 1
    while True:
        num -= p
        if num>=0:
            ans += 1
        else:
            break 
        p += 1   

print(ans)

Solution (Python):
import math 
def primeFactors(n): 
    a=[]  
    while n % 2 == 0: 
        a.append(2) 
        n = n // 2
    for i in range(3,int(math.sqrt(n))+1,2):  
        while n % i== 0: 
            a.append(i) 
            n = n // i  
    if n > 2: 
        a.append(n) 
    return a    
import math as m
n=int(input())
x=0
i=0
a=list(set(primeFactors(n)))
ans=0
p=1
flag=False
while(i<len(a)):
    j=a[i]
    x=a[i]
    while(True):
        if n%j==0:  
            ans+=1 
            n//=j
            j*=x
        else:
            break
        if p==n:
            flag=True
            break
    if(flag):break    
    i+=1         
print(ans)

Solution (Python):
import collections

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

N = int(input())
A = prime_factorize(N)

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

cnt = 0
B = []
a,b = 0,0
for i in range(10**3):
    a += 1
    b += a
    B.append(b)

ls = collections.Counter(A)

for k in ls.values():
    i = 0
    while k >= B[i]:
        i +=1
    cnt += i
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

n = int(input())
a = prime_factorize(n)
c = collections.Counter(a)
num = 0
for v in c.values():
    for i in range(1,n):
        v -= i
        if v >=0:
            num +=1
        else:break

print(num)

Solution (Python):
import sys, io, os, re
import bisect
from pprint import pprint
from math import sin, cos, pi, radians, sqrt, floor
from copy import copy, deepcopy
from collections import deque
from fractions import gcd
from functools import reduce

def array1(n): return [0] * n
def array2(n, m): return [[0] * m for x in range(n)]
def array3(n, m, l): return [[[0] * l for y in xrange(m)] for x in xrange(n)]

N = int(sys.stdin.readline().strip())

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

e = factorization(N)


ans = 0
for p, q in e:
    c = 0
    j = 1
    while c+j <= q:
        c += j
        j += 1

    ans += (j-1)
    

print(ans)

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

N = int(input())
from collections import Counter
c = Counter(prime_decomposition(N))
ans = 0
for i in c:
    k = 1
    while(c[i]-k>=0):
        if c[i]>0:
           c[i] -= k
           ans += 1
           k += 1
print(ans)

Solution (Python):
import math
n=int(input())
p=2
c=0
curr=0
while n%p==0:
    curr+=1
    n//=p
j=0
j=(math.sqrt(1+8*curr)-1)//2
c+=int(j)

for i in range (3,int(math.sqrt(n))+1,2):
    p=i
    curr=0
    while n%p==0:
        curr+=1
        n//=p
    j=0
    j=(math.sqrt(1+8*curr)-1)//2
    c+=int(j)
    
if n>2:
    c+=1
print(c)

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

data = factorize(N)

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

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


count = 0

arr = factorization(N)

for a in arr:
    now = a[0]
    now_z = a[0]
    while True:
        if N % now_z == 0:
            count += 1
            N //= now_z
            now_z *= now
        else:
            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(cnt)
    if temp!=1:
        arr.append(1)
    if arr==[]:
        arr.append(1)
    return arr

def calc(n):
    val = 1
    count = 0
    for i in range(2,100000):
        count += 1
        val = val + i
        if val > n:
            return count

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

arr = factorization(N)

ans = 0 
for val in arr:
    ans += calc(val)
 
print(ans)

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


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(input, print):
    n = int(input())
    ans = 0
    ret = factorization(n)
    if ret[0][0] == 1:
        print('0')
        return
    for i in range(len(ret)):
        cnt = 0
        while ret[i][1] > 0:
            cnt += 1
            ret[i][1] -= cnt
            ans += 1
        if ret[i][1] < 0:
            ans -= 1

    print(ans)


if __name__ == '__main__':
    main(sys.stdin.readline, print)

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 calc_n_value(i):
  return(int((
    ((i*8+1)**0.5-1)*0.5
  )//1))

n=int(input())
fcts = prime_factorize(n)
tmp = Counter(fcts).values()
out=0
for _ in tmp:
  out += calc_n_value(_)
print(out)

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

comb = factorization(n)
lst = []
for i in comb:
    for j in range(i[1]):
        lst.append(i[0]**(j+1))

lst.sort()
ans = 0
for i in lst:
    if n == 1:
        break
    elif n > 1:
        if n%i == 0:
            n = n/i
            ans += 1
print(ans)

Solution (Python):
import numpy as np
from math import sqrt

def sieve(n):
    S = [True] * (n+1)
    S[0] = S[1] = False
    i = 2
    while i * i <= n:
        if S[i]:
            k = i * i
            while k <= n:
                S[k] = False
                k += i
        i += 1
    return S

  
def arrayF(n): 
    F=[0]*(n+1) 
    i=2 
    while i*i<=n:
        if F[i] == 0: 
            k=i*i
            while k <= n:
                if F[k] == 0:
                    F[k] = i
                k += i
        i += 1 
    return F


def factorization(x, F): 
    primeFactors = [] 
    while (F[x] > 0):
        primeFactors.append(F[x])
        x //= F[x] 
    primeFactors.append(x) 
    return primeFactors


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

rt = int(sqrt(n)+1)
S = sieve(rt)
primes = np.arange(rt+1)[S]

for i in primes:
    if n % i == 0:
        break
else:
    print(1)  
    exit(0)

m = n
facts = {}
for i in primes:
    if m % i == 0:
        facts[i] = 0
        while m % i == 0:
            m //= i
            facts[i] += 1
if m != 1:
    facts[m] = 1

for k in facts:
    v = facts[k]
    if v < 3:
        facts[k] = 1
    elif v < 6:
        facts[k] = 2
    elif v < 10:
        facts[k] = 3
    elif v < 15:
        facts[k] = 4
    elif v < 21:
        facts[k] = 5
    elif v < 28:
        facts[k] = 6
    elif v < 36:
        facts[k] = 7
    elif v < 45:
        facts[k] = 8
    elif v < 55:
        facts[k] = 9
    elif v < 66:
        facts[k] = 10
print(sum(facts.values()))

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

S = factorization(N)
ans=0
start=1
for i in S:
  U=0
  for j in range(1,i[1]+1):
    U+=j
    ans+=1
    if U>i[1]:
      ans-=1
      break
print(ans)