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
import collections
N = int(input())
Ans = 0

if N <= 1:
  print(Ans)
  sys.exit()

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

c = collections.Counter(prime_factorize(N))
A = list(c.values())
p = len(A)



Ans = Ans + p
now = 0

for r in range(p):
  now = int(A[r]) - 1
  loop = 2

  for q in range(1000):
    now = now - loop
    if now >= 0:
      Ans = Ans + 1
      loop = loop + 1
    else:
      break

print(Ans)

Solution (Python):
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate, product, combinations_with_replacement
import sys
import bisect
import string
import math
import time


def I(): return int(input())
def S(): return input()
def MI(): return map(int, input().split())
def MS(): return map(str, input().split())
def LI(): return [int(i) for i in input().split()]
def LI_(): return [int(i)-1 for i in input().split()]
def StoI(): return [ord(i)-97 for i in input()]
def ItoS(nn): return chr(nn+97)
def input(): return sys.stdin.readline().rstrip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def print_matrix(mat):
    for i in range(len(mat)):
        print(*['IINF' if v == IINF else "{:0=4}".format(v) for v in mat[i]])


yn = {False: 'No', True: 'Yes'}
YN = {False: 'NO', True: 'YES'}
MOD = 10**9+7
inf = float('inf')
IINF = 10**19
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
show_flg = False


def factorization(n):
    if n <= 1:
        return []

    ret = []
    while n > 2 and n % 2 == 0:
        ret.append(2)
        n //= 2
    i = 3
    while i <= math.sqrt(n):
        if n % i == 0:
            ret.append(i)
            n //= i
        else:
            i += 2
    ret.append(n)
    return ret


def main():
    N = I()
    a = factorization(N)
    ans = 0
    cnts = Counter(a)
    cursor = defaultdict(int)
    d = [i for i in range(1, 1000)]
    d = list(accumulate(d))

    for k in cnts.keys():
        sep = bisect.bisect_right(d, cnts[k])
        
        ans += sep

    
    print(ans)



if __name__ == '__main__':
    main()

Solution (Python):
ma = lambda :map(int,input().split())
ni = lambda:int(input())
import collections
import math
import itertools
gcd = math.gcd
n  = ni()
def f(cnt):
    ret  = 0
    for i in range(1,10**9):
        ret +=i
        if ret>cnt:
            return i-1
def factorize(n):
    b = 2
    fct = [(1,1)]
    while b * b <= n:
        cnt =0
        while n % b == 0:
            n //= b
            cnt +=1
        if cnt >=1:
            fct.append((b,cnt))
        b = b + 1
    if n > 1:
        fct.append((n,1))
    return fct
d = factorize(n)
ans = 0
for num,cnt in d:
    ans += f(cnt)
print(ans-1)

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

from collections import Counter

N = int(open(0).read())
l = prime_factorize(N)
c = Counter(l)
ans = 0
cl = [x for x in c.values()]
for i in range(1,41):
    for j in range(len(cl)):
        if cl[j] >= i:
            ans += 1
            cl[j] -= i
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())
c = collections.Counter(prime_factorize(n))
ans=0
for i in c:
    tmp=1
    while 1:
        c[i]-=tmp
        if c[i]>=0:
            ans+=1
        else:
            break
        if c[i]==0:
            break
        tmp+=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
    
ans=0
n=int(input())
if n==1:
    print(0)
    exit()

cnt=collections.Counter(prime_factorize(n))
for num in cnt.values():
    if num<3:
        ans+=1
    elif num<6:
       ans+=2
    elif num<10:
        ans+=3
    elif num<15:
        ans+=4
    elif num<21:
        ans+=5
    elif num<28:
        ans+=6
    elif num<36:
        ans+=7
    elif num<45:
        ans+=8
    else:
        num+=9
print(ans)

Solution (Python):
def factorize(n):
    i=2
    result={}
    while True:
        if i**2>n:
            break
        count=0
        while n%i==0:
            n//=i
            count+= 1
        if count!=0:
            result[i]=count
        i+=1
    if n>1:
        result[n]=1
    return result

def count(v):
    cnt=0
    num=1
    while cnt<=v:
        cnt+=num
        num+=1
        
    return num-2

def main():
    n=int(input())
    F=factorize(n)
    
    ans=0
    for val in F.values():
        
        ans+=count(val)
    print(ans)
    
if __name__=='__main__':
    main()

Solution (Python):
from collections import defaultdict


def main():
    N = int(input())
    i = 2
    primes = defaultdict(int)
    while i**2 <= N:
        while N % i == 0:
            primes[i] += 1
            N //= i
        i += 1
    if N > 1:
        primes[N] = 1
    elements = list(primes.values())
    ans = 0
    for i in range(len(elements)):
        for j in range(1, 10):
            if elements[i] >= j:
                elements[i] -= j
                ans += 1
    print(ans)


if __name__ == "__main__":
    main()

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

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

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

    return arr

import math

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

Solution (Python):
a=int(input())
ans = 0
tmp = 2 
while tmp*tmp <=a:
    ct = 0 
    while not a % tmp:
        ct+=1
        a/=tmp
    for i in range(1,ct+1):
        if (1+i)*i/2<=ct:
            ans+=1
        else:
            break
    tmp+=1
if a != 1:
    ans+=1
print(ans)

Solution (Python):
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): 
	return list(map(int,input().split()))
def m(): 
	return map(int,input().split())
def onem(): 
	return int(input())
def s(x): 
	a = []
	if len(x) == 0:
		return []
	aa = x[0]
	su = 1
	for i in range(len(x)-1):
		if aa != x[i+1]:
			a.append([aa,su])
			aa = x[i+1]
			su = 1
		else:
			su += 1
	a.append([aa,su])
	return a
def jo(x): 
	return " ".join(map(str,x))
def max2(x): 
	return max(map(max,x))
def In(x,a): 
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
	ll = 0
	rr = r
	while True:
		mid = (ll+rr)//2

	if rr == mid:
		return ll
	if (ここに評価入れる):
		rr = mid
	else:
		ll = mid+1
"""

def make_primes(n): 
    ass = []
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    for i in range(len(is_prime)):
        if is_prime[i]:
            ass.append(i)
    return ass  


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(int(n))
  return table

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)

    
    return divisors

n = onem()

kkk = prime_decomposition(n)
ppp = make_divisors(n)
k = s(kkk)
ans = 0

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

Solution (Python):
from __future__ import division, print_function

''' Hey stalker :) '''
INF = 10 ** 10
TEST_CASES = False
import math

def prime_factors(n):  
    factors = dict()
    for i in range(2, math.ceil(math.sqrt(n)) + 1):
        while n % i == 0:
            if i in factors:
                factors[i] += 1
            else:
                factors[i] = 1
            n = n // i
    if n > 2:
        factors[n] = 1
    return (factors)

def main():
    n = get_int()
    fac = prime_factors(n)
    
    res = 0
    for key in fac:
        base = 1
        while fac[key]>=base:
            res += 1
            fac[key] -= base
            base += 1
    print(res)


''' FastIO Footer: PyRival Library, Thanks @c1729 and contributors '''
import os
import sys
from bisect import bisect_left, bisect_right
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip
BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)



input = lambda: sys.stdin.readline().rstrip("\r\n")
get_int = lambda: int(input())
get_list = lambda: list(map(int, input().split()))

if __name__ == "__main__":
    if TEST_CASES:
        [main() for _ in range(int(input()))]
    else:
        main()

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
target=factorization(N)
ans=0
for i in target:
    count=1
    while(i[1]>=count):
        ans+=1
        i[1]-=count
        count+=1
print(ans)

Solution (Python):
from math import sqrt
from collections import Counter

def prime_factorization(n):
    counter = Counter()
    for i in range(2, int(sqrt(n)) + 1):
        while n % i == 0:
            n //= i
            counter[i] += 1

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

    return list(counter.items())

N = int(input())

candinates = []

for p, c in prime_factorization(N):
    
    i = 1
    while i <= c:
        candinates.append(pow(p, i))
        c -= i
        i += 1


candinates.sort()



count = 0
for z in candinates:
    N, r = divmod(N, z)
    if r != 0:
        break
    count += 1

print(count)

Solution (Python):
N=int(input())
fn=N
li=[0]*(10**6+100)
flag=False
if N==1:
  print(0)
  exit()
for i in range(2,int(N**0.5)+1):
  while N%i==0:
    flag=True
    N/=i
    li[i]+=1
if flag==False:
  print(1)
  exit()

ans=0
if N>fn**0.5:
  ans+=1
  
for count in li:
  use=1
  while count-use>=0:
    ans+=1
    count-=use
    use+=1
print(ans)

Solution (Python):
def f(x):
    c = 1

    while x >= c:
        x -= c
        c += 1

    return c - 1


N = int(input())

ans = 0
for i in range(2, round(N**.5)):
    x = 0

    while N%i == 0:
        x += 1
        N //= i

    if x > 0:
        ans += f(x)


if N > 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

ls = factorization(N)

ans = 0
for p,e in ls:
    i = 1
    if p != 1:
        while e-i >= 0:
            e -= i
            i += 1
            ans += 1
print(ans)

Solution (Python):
import math
from functools import reduce
from collections import deque, Counter
import sys
sys.setrecursionlimit(10**7)

def input():
    return sys.stdin.readline().strip()


def get_nums_l():
    return [ int(s) for s in input().split(" ")]


def get_nums_n(n):
    return [ int(input()) for _ in range(n)]


def get_all_int():
    return map(int, open(0).read().split())

def rangeI(it, l, r):
    for i, e in enumerate(it):
        if l <= i < r:
            yield e
        elif l >= r:
            break

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

INF = 999999999999999999999999
MOD = 10**9+7

n = int(input())

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












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

    if len(arr) == 0:
        arr.append((n, 1))
    return arr

fac_ = prime_factorize(n)
fac = Counter(fac_)


ans = 0
for p,e in fac.items():
    
    x = e
    for i in range(1, 99999999):
        if x >= i:
            x -= i
            ans += 1
        else:
            break

print(ans)

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

c = collections.Counter(prime_factorize(N))

l = list(c.keys())
v = list(c.values())
cnt = 0
for i in range(len(l)):
    cnt += math.floor((math.sqrt(1+8*v[i])-1)/2)

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

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

primes = factorization(N)

ans = 0
for _, cnt in primes:
    n = 0
    while n * (n + 1) // 2 <= cnt:
        n += 1
    ans += n - 1

print(ans)

Solution (Python):






import collections
import math

n = int(input())

c = collections.Counter()
i=2
nn = n
while nn!=1:
  
  if i>math.sqrt(nn):
    c[nn]+=1
    break
  if nn%i==0:
    c[i]+=1
    nn = nn // i
  else:
    i += 1


ans = 0
for i in c.keys():
  j = 1
  while j<=c[i]:
    ans+=1
    c[i]-=j
    j+=1

if n==1:
  ans = 0

print(ans)

Solution (Python):
from sys import stdin
from sys import setrecursionlimit
from collections import Counter, deque, defaultdict
from math import floor, ceil
from bisect import bisect_left
from itertools import combinations
setrecursionlimit(100000)

INF = int(1e10)
MOD = int(1e9 + 7)

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():
    from builtins import int, map
    n = int(input())
    if n == 1:
        print(0)
        exit()

    fn = factorization(n)
    cmax = max([f[1] for f in fn])
    z = set({})

    k = 1
    flag_get = True
    while flag_get and k <= cmax:
        flag = False
        for i in range(len(fn)):
            pi, ni = fn[i]
            if ni >= k:
                flag = True
                z.add(pi ** k)
                fn[i][1] -= k
        if not flag:
            break
        k += 1
    print(len(z))

if __name__ == '__main__':
    main()

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

chk = factorization(n)
ans = 0
cnt = 2
ss = 1
for num,k in chk:
  while k >= ss:
    ans += 1
    ss += cnt
    cnt += 1
    
  ss = 1
  cnt = 2

print(ans)

Solution (Python):
import collections
import bisect

def prim(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=prim(n)
c = collections.Counter(p)
d=c.values()
m=0

l=[1]
for i in range(2,100):
        l.append(i+l[-1])
for i in d:
        m+=bisect.bisect_right(l,i)
print(m)

Solution (Python):


iim = lambda: map(int, input().rstrip().split())

def factor(n):
    ans = []
    i = 0
    while n & 1 == 0:
        n >>= 1
        i += 1

    if i > 0:
        ans.append((2, i))

    for i in range(3, int(n**.5) +1, 2):
        x, y = divmod(n, i)

        if y == 0:
            j = 1
            x1 = x
            while True:
                x1, y = divmod(x, i)
                if y == 0:
                    x = x1
                    j += 1
                else:
                    ans.append((i, j))
                    break
            n = x

    if n > 1:
        ans.append((n, 1))

    return ans

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

    ans = 0
    for a, b in factor(N):
        c = 1
        while b >= c:
            b -= c
            ans += 1; c += 1
    print(ans)

if __name__ == "__main__":
    resolve()

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()
res = factorization(n)
d = dict()
for i,j in res:
    d[i] = j
ans = 0
for n in d.keys():
    for i in range(100):
        
        if d[n] < i*(i+1)//2:
            ans += i-1
            break
        else:
            pass
print(ans)

Solution (Python):




import sys
from io import StringIO
import unittest

def xxx(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 resolve():
    readline=sys.stdin.readline

    h=int(readline())
    if h==1:
        print(0)
        return
    arr=xxx(h)
    ans=0
    for a in arr:
        n=a[1]
        i=1
        cnt=0
        while n>0:
            n-=i
            i+=1
            cnt+=1
        if n<0:
            cnt-=1
        ans+=cnt
    print(ans)
    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

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

def solve():
    if N == 1:
        print(0)
        return 0
    
    ans = 0
    lst = factorization(N)
    for ps in lst:
        es = ps[1]

        tmp = 1
        while es >= tmp:
            es -= tmp
            ans += 1
            tmp += 1
    
    print(ans)
    return 0




solve()

Solution (Python):


import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

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

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

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

    return arr

n = I()
if n == 1:
    print(0)
    quit()
f = factorization(n)
ans = 0
for i, j in f:
    tmp = 1
    while j >= tmp:
        ans += 1
        j -= tmp
        tmp += 1
print(ans)

Solution (Python):


import array
import collections
import math
import sys


def sieve_of_eratosthenes(end, typecode="L"):
    assert end > 1
    is_prime = array.array("B", (True for i in range(end)))
    is_prime[0] = False
    is_prime[1] = False
    primes = array.array(typecode)
    for i in range(2, end):
        if is_prime[i]:
            primes.append(i)
            for j in range(2 * i, end, i):
                is_prime[j] = False
    return primes


def factorize_trial_division(n, typecode="L"):
    factors = array.array(typecode)
    if n < 2:
        return factors
    for p in sieve_of_eratosthenes(math.ceil(math.sqrt(n)) + 1):
        if p * p > n:
            break
        while n % p == 0:
            factors.append(p)
            n //= p
    if n > 1:
        factors.append(n)
    return factors


def solve(n):
    if n < 2:
        return 0
    pf = collections.Counter(factorize_trial_division(n))
    
    res = 0
    trigs = [i * (i + 1) // 2 for i in range(20)]
    num_trigs = len(trigs)
    for _, v in pf.items():
        for i in range(num_trigs - 1):
            if trigs[i] <= v < trigs[i + 1]:
                res += i
                break
    return res


def main():
    n = int(input())
    res = solve(n)
    print(res)


if __name__ == '__main__':
    main()

Solution (Python):

import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**6)
INF = float('inf')
MOD = 10 ** 9 + 7
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(rs())
def rf(): return float(rs())
def rs_(): return [_ for _ in rs().split()]
def ri_(): return [int(_) for _ in rs().split()]
def rf_(): return [float(_) for _ in rs().split()]
def divisors(n, sortedresult=True):
    div = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            div.append(i)
            if i != n // i:
                div.append(n//i)
    if sortedresult:
        div.sort()
    return div


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 = ri()
D = factorization(N)
L = []
tmp = 0
for i in range(1, 41):
    tmp += i
    L.append(tmp)
ans = 0
for d in D:
    if d[0] == 1:
        continue
    ans += bisect_right(L, d[1])
print(ans)

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

import math

N_tmp = N
cnt = {}
for p in range(2, int(math.sqrt(N)) + 1):
    i_p = 0
    while N_tmp % p == 0:
        i_p += 1
        N_tmp //= p
    
    if i_p < 1: continue
    cnt[str(p)] = i_p
else:
    if N_tmp > 1: cnt[str(N_tmp)] = 1

ans = 0
for p in cnt.keys():
    for i in range(64):
        if (i + 1) * (i + 2) // 2 > cnt[p]: break
    
    ans += i

print(ans)

Solution (Python):
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))

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

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

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

    return arr

def do():
    ans=0
    n=INT()
    s=factorization(n)
    for a,b in s:
        temp=0
        for i in range(10):
            temp+=(i+1)
            
            if temp<=b:
                ans+=1
            else:
                break
    if n==1:
        ans=0
    
    print(ans)

                
if __name__ == '__main__':
    do()

Solution (Python):
n = int(input())
res = 0
from bisect import bisect_right
aa = [j*(j+1)//2 for j in range(1,22)]
    
for i in range(2,10**6):
    if n%i==0:
        cnt = 0
        while n%i==0:
            n = n//i
            cnt += 1

        res += bisect_right(aa, cnt)
    if n == 1:
        break
else:
    res += 1
print(res)

Solution (Python):
from bisect import bisect_right
import sys

n = int(input())

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

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

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

res = 0
for v, c in l:
    res += bisect_right(x, c)

print(res)

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 collections.Counter(a)

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

cnt = 0
for p in ps:
  c = ps[p]
  i = 1
  while c >= i:
    cnt += 1
    c -= i
    i += 1
print(cnt)