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 factorization(n):
    factorization_list = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            count = 0
            while temp % i == 0:
                count += 1
                temp //= i
            factorization_list.append([i, count])

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

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

    return factorization_list


if __name__ == "__main__":
    N = int(input())

    if N == 1:
        print(0)

    else:
        factorization_list = factorization(N)
        count = 0
        for factor in factorization_list:
            e = factor[1]
            i = 1
            while True:
                e -= i
                i += 1
                count += 1
                if e < i:
                    break
        print(count)

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

    
    cnt = 0
    for l in arr:
        factor = l[0]
        i = l[1]
        if factor != 1:
            div = 0
            while 1:
                div += 1
                i -= div
                if i >= 0:
                    cnt += 1
                else:
                    break

    return cnt


print(factorization(N))

Solution (Python):
n = int(input())
import math
import numpy as np
t = []
b = n

for i in range(int(math.sqrt(n))):
    if b >= i+2:
        flag = True
        if b % (i + 2) == 0 and flag == True:
            flag = False
            t.append(0)
            while b % (i + 2) == 0:
                t[-1] += 1
                b /= (i+2)
                
                
    
ans = 0




tt = t

for i in range(len(t)):
    count = 1
    while t[i] >= count:
        ans += 1
        t[i] = t[i] - count
        count += 1





if n != 1 and ans == 0:
    print('1')
    exit()

if n!= 1 and b != 1:
    ans += 1

print(ans)

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

n=10**6

prime = {i for i in range(2,n)}
for i in range(2,n):
    if i in prime:
        for j in range(i*2,n,i):
            if j in prime:
                prime.remove(j)
from collections import defaultdict
def prime_factorization(N):
    dic=defaultdict(int)
    for some in prime:
        if N%some==0:
            while N%some==0:
                N=N//some
                dic[some]+=1
        else:
            pass
    if N!=1:
        dic[N]=1
    return dic
ans=0
K=prime_factorization(N)
import bisect
H=[i*(i-1)//2 for i in range(10**4)]

for value in K.values():
    ans+=bisect.bisect_right(H,value)-2
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
    
a=factorization(int(input()))

b=[1,3,6,10,15,21,28,36,43]

ans=0
if len(a)==1 and a[0][0]==1:
    print(0)
    exit()

for i in a:
    for j in range(len(b)):
        if i[1]<b[j]:
            ans+=j
            break
print(ans)

Solution (Python):
from functools import reduce
from math import gcd
from random import randint


def brent(N):
    if N % 2 == 0:
        return 2
    y, c, m = randint(1, N-1), randint(1, N-1), randint(1, N-1)
    g, r, q = 1, 1, 1
    while g == 1:
        x = y
        for i in range(r):
            y = ((y*y) % N+c) % N
        k = 0
        while (k < r and g == 1):
            ys = y
            for i in range(min(m, r-k)):
                y = ((y*y) % N+c) % N
                q = q*(abs(x-y)) % N
            g = gcd(q, N)
            k = k + m
        r = r*2
    if g == N:
        while True:
            ys = ((ys*ys) % N+c) % N
            g = gcd(abs(x-ys), N)
            if g > 1:
                break
    return g


def factorize(n1):
    if n1 == 0:
        return []
    if n1 == 1:
        return [1]
    n = n1
    b = []
    p = 0
    mx = 1000000
    while n % 2 == 0:
        b.append(2)
        n //= 2
    while n % 3 == 0:
        b.append(3)
        n //= 3
    i = 5
    inc = 2
    while i <= mx:
        while n % i == 0:
            b.append(i)
            n //= i
        i += inc
        inc = 6-inc
    while n > mx:
        p1 = n
        while p1 != p:
            p = p1
            p1 = brent(p)
        b.append(p1)
        n //= p1
    if n != 1:
        b.append(n)
    return sorted(b)


n = int(input())
if n == 1:
    print(0)
    quit()
li = factorize(n)


def sums(factors):
    dicc = {}
    for factor in set(factors):
        n = factors.count(factor)
        dicc[factor] = [1]
        n -= 1
        while n > dicc[factor][-1]:
            dicc[factor].append(dicc[factor][-1] + 1)
            n -= dicc[factor][-1]
    return dicc




count = 0
for i in sums(li).values():
    count += len(i)
print(count)

Solution (Python):
n=int(input())
a=p=1
while p<1e6:
 c=t=0;p+=1
 while n%p<1:n/=p;x=c==t;t+=x;c+=1-t*x;a+=x
print(a-(n<2))

Solution (Python):
n=int(input())
a=p=1
while p<1e6:
 c=t=0;p+=1
 while n%p<1:n/=p;c+=1;x=c>t;t+=x;c-=t*x;a+=x
print(a-(n<2))

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

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

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

    return arr



def pop(stack):
	return stack[0],stack[1:]

def push(stack,x):
	stack.append(x)
	s = set(stack)
	p = list(s)
	p.sort()
	return p

n = int(input())

a = factorization(n)
ans = 0
if n != 1:
	for i in a:
		t = 1
		k = 1
		while t <= i[1]:
			
			ans += 1
			k += 1
			t += k
			
	
print(ans)

Solution (Python):
n = int(input())
primes = dict()
p = 2

while p * p < n:
  if n % p == 0:
    primes[p] = 0
    while n % p == 0:
      n //= p
      primes[p] += 1
  p += 1
if p * p == n:
  primes[p] = 2
elif n >= p:
  primes[n] = 1

count = 0
for e in primes.values():
  c = 1
  while c * (c + 1) // 2 <= e:
    c += 1
  count += c - 1
  
print(count)

Solution (Python):
import sys
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 main():
    read = lambda: sys.stdin.readline().rstrip()
    
    
    a = int(read())
    cnt = collections.Counter(prime_factorize(a))
    tot = 0
    for val in cnt.values():
        cnt = 0
        while val > 0:
            cnt += 1
            val -= cnt
            if val < 0:
                cnt -= 1
                break
            if val == 0: break
        tot += cnt
    print(tot)
 
if __name__ == "__main__":
    main()

Solution (Python):
from collections import defaultdict
import math

def soi(num_ref):
    arr = []
    num = num_ref
    for i in range(2, int(math.sqrt(num))+1):
        if num%i == 0:
            cnt = 0
            while num%i == 0:
                cnt += 1
                num //= i
            arr.append([i, cnt])
    if num != 1:
        arr.append([num, 1])
    if arr == []:
        arr.append([num_ref, 1])
    return arr

N = int(input())
if N == 1:
    print(0)
    exit()
arr = soi(N)
cnt = 0
for i in arr:
    minus = 1
    tmp = i[1]
    while(tmp - minus >= 0):
        tmp -= minus
        minus += 1
        cnt += 1
print(cnt)

Solution (Python):
n = int(input())
cnt=0
factor=[]
for i in range(2, int(n**.5)+1):
    j=1
    while n%i==0:
        n//=i
        factor.append(i)
if n>1:
    cnt+=1


def f(x):
    i=1
    cnt=0
    while x>=i:
       x-=i
       i+=1
       cnt+=1
    return cnt

from itertools import groupby
for k,v in groupby(factor):
    cnt+=f(len(list(v)))
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 func(a,b):
    cnt = 0
    exp = 1
    borg = b
    while True:
        b = pow(borg, exp)
        if(a%b != 0):
            break
        a = a/b
        exp = exp + 1
        cnt = cnt + 1

    return cnt

input = input()
c = collections.Counter(prime_factorize(int(input)))
L = list(c.values())
K = list(c.keys())
ans = 0
k = 0
for i in range(len(L)):
    k = int(K[i])
    f = func(int(input),k)
    ans = ans + f

print(ans)

Solution (Python):
import math
import numpy as np
n = int(input())
fac = []
sqrt_n = math.sqrt(n)
for i in range(2, int(sqrt_n)):
    if not n % i:
        fac.append(0)
    while not n % i:
        n /= i
        fac[-1] += 1
if n > sqrt_n:
    fac.append(1)
num = 0
for f in fac:
    num += np.count_nonzero(f >= np.cumsum(range(1, f+1)))
print(num)

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    def prime_factorize1(N):
        l = []
        x = N
        y = 2
        while y*y <= x:
            while x % y == 0:
                l.append(y)
                x //= y
            y += 1
        if x > 1:
            l.append(x)
        return l

    from collections import Counter
    c=Counter(prime_factorize1(n))
    num=list(c.values())
    ans=0
    for i in num:
        x=i
        for j in range(1,i+1):
            if x-j>=0:
                ans+=1
                x-=j
            else:
                break
    print(ans)
resolve()

Solution (Python):
import math
import decimal


def main():

    N = int(input())
    ans = 0
    A = int(math.ceil(N**0.5)+1)
    explist = []
    flag = False
    if N >= 3:
        for L in range(2, A):
            if N < L:
                break
            d = L
            cnt = 0
            while(True):
                if N % d == 0:
                    N /= d
                    cnt += 1
                    flag = True
                else:
                    break
            explist.append([d, cnt])
        for i in explist:
            c = i[1]
            for j in range(1, A):
                if c >= j:
                    ans += 1
                    c -= j
                else:
                    break
        if N >= A:
            ans += 1
        if flag:
            print(ans)
            return
        else:
            print(1)
            return
    elif N == 2:
        print(1)
        return
    else:
        print(0)
        return


if __name__ == '__main__':
    main()

Solution (Python):
import collections
n=int(input())
ans=0
d=1
m=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

c=collections.Counter(prime_factorize(n))
for i in range(len(list(c.values()))):
    while d*(d+1)/2<list(c.values())[i]+1:
        if m<=d:
            m=d
            d+=1
    if d*(d+1)/2>=list(c.values())[i]+1:
        ans+=m
        d=1
        m=0
print(ans)

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

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





from math import sqrt
def solve(x):
    return int((sqrt(1 + 8 * x) - 1)/2)



count = 0
for i in Counter(prime_factorize(m)).values():
    count += solve(i)
print(count)

Solution (Python):
n = int(input())
if n == 1:
    print(0)
    exit()
F = {}
tmp = n
i = 2
while i**2 <= tmp:
    cnt = 0
    while tmp % i == 0:
        cnt += 1
        tmp //= i
    if cnt > 0:
        F[i] = cnt
    i += 1
if tmp != 1 or F == {}:
    F[tmp] = 1
ans = 0
for p in F:
    a = 1
    while F[p] >= a:
        F[p] -= a
        ans += 1
        a += 1
print(ans)

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

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

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

X=list(c.values())
ans=0
for i in range(len(c.values())):
    for j in range(1,100):
        if X[i]<(j+1)*j/2:
            ans+=j-1
            break

print(ans)

Solution (Python):
import numpy as np
import math

def fuctrization(n):
    arr = []
    tmp = n
    for i in range(2,math.ceil(n**(1/2))+1):
        if tmp%i==0:
            j = 0
            while tmp%i==0:
                j += 1
                tmp //= i
            arr.append([i,j])
    if tmp != 1:
        arr.append([tmp,1])
    if arr:
        pass
    else:
        arr.append([n,1])
            
    return arr
            
        
        
n = int(input())
if n == 1:
    print(0)
else:
    arr = fuctrization(n)
    nn = 0
    for i in range(len(arr)):
        k = arr[i][1]
        nnn = 1
        while k-nnn>=0:
            k -= nnn
            nnn += 1
            nn +=1
    print(nn)

Solution (Python):
import sys
from collections import defaultdict

readline = sys.stdin.readline


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


def isqrt(n):
    if n > 0:
        x = 1 << (n.bit_length() + 1) // 2
        y = (x + n // x) // 2
        while y < x:
            x = y
            y = (x + n // x) // 2
        return x
    elif n == 0:
        return 0
    else:
        raise ValueError("isqrt() argument must be nonnegative")


def main():
    N = int(readline())
    c = prime_factorize(N)

    ans = 0
    for power in c.values():
        ans += (isqrt(1 + 8 * power) - 1) // 2

    print(ans)
    return


if __name__ == '__main__':
    main()

Solution (Python):
N=int(input())
F={}
for i in range(2,int(N**0.5)+1):
    if N%i==0:
        F[i]=1
        N//=i
    while N%i==0:
        N//=i
        F[i]+=1
if N>1:
    F[N]=1

ans=0
for f in F:
    j=1
    while True:
        F[f]-=j
        j+=1
        if F[f]>=0:
            ans+=1
        else:
            break
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())
sum = 0
c = collections.Counter(prime_factorize(n))
index = 1
for i in c.values():
    tmp = i
    
    for j in range(i):
        if j+1 > tmp:
            break
        tmp -= j+1
        sum += 1
print(sum)

Solution (Python):
import sys
from collections import Counter

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


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 isqrt(n):
    if n > 0:
        x = 1 << (n.bit_length() + 1) // 2
        y = (x + n // x) // 2
        while y < x:
            x = y
            y = (x + n // x) // 2
        return x
    elif n == 0:
        return 0
    else:
        raise ValueError("isqrt() argument must be nonnegative")


def main():
    N = int(readline())
    c = Counter(prime_factorize(N))

    ans = 0
    for power in c.values():
        ans += (isqrt(1 + 8 * power) - 1) // 2

    print(ans)
    return


if __name__ == '__main__':
    main()

Solution (Python):
import sys
from collections import Counter

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


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():
    N = int(readline())
    c = Counter(prime_factorize(N))

    ans = 0
    for power in c.values():
        tmp = power
        for j in range(1, power + 1):
            if j > tmp:
                break
            tmp -= j
            ans += 1

    print(ans)
    return


if __name__ == '__main__':
    main()

Solution (Python):
import sys
from collections import Counter

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


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():
    N = int(readline())
    a = Counter(prime_factorize(N))

    ans = 0
    for power in a.values():
        tmp = power
        for j in range(1, power + 1):
            if tmp >= j:
                tmp -= j
                ans += 1
            else:
                break

    print(ans)
    return


if __name__ == '__main__':
    main()

Solution (Python):
import sys
from collections import defaultdict

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


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


def main():
    N = int(readline())
    a = prime_factorize(N)

    ans = 0
    for power in a.values():
        tmp = power
        for j in range(1, power + 1):
            if tmp >= j:
                tmp -= j
                ans += 1
            else:
                break

    print(ans)
    return


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

a=int(input())
if a==1:
  print(0)
else:
  lis=factorization(a)
  ans=0
  for i in range(len(lis)):
    k=1
    while lis[i][1]>=k:
      lis[i][1] -= k
      k+=1
      ans+=1
  print(ans)

Solution (Python):
import sys
from collections import Counter
def main():
    n = int(input())

    def is_prime(n):
        for i in range(2, n + 1):
            if i * i > n:
                break
            if n % i == 0:
                return False
        return n != 1

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


    if is_prime(n):
        print(1)
        sys.exit()

    pd = prime_dec(n)
    pdc = Counter(pd)
    pdcl = [pdc[i] for i in pdc]
    r = 0
    for pse in pdcl:
        num = pse
        cnt = 1
        while num > 0:
            if cnt > num:
                break
            else:
                r += 1
                num -= cnt
                cnt += 1
    print(r)


if __name__ == '__main__':
    main()

Solution (Python):

N=int(input())
N_C=N
P={}
for i in range(2,10**6+1):
    if N%i==0:
        P[i]=0
        while True:
            N=N/i
            P[i]+=1
            if N%i!=0:
                break
    if N==1:
        break
if N_C==1:
    print(0)
elif P=={}:
    print(1)
else:
    ans=0
    for key,v in P.items():
        z=key**v
        L=[0]+[True for i in range(v)]
        for i in range(1,v+1):
            if L[i]:
                if z%(key**i):
                    break
                z=z/(key**i)
                L[i]=False
                ans+=1
    if N!=1:
        ans+=1
    print(ans)

Solution (Python):
from math import sqrt, ceil, floor

def factorize(x):
    result = []
    for p in range(2, floor(sqrt(x))):
        exp = 0
        while x % p == 0:
            exp += 1
            x = x // p
        if exp > 0:
            result.append((p, exp))
    if x > 1:
        result.append((x, 1))
    return result

N = int(input())
factors = factorize(N)
ans = sum([floor((sqrt(exp * 8 + 1) - 1) / 2) for p, exp in factors])
print(ans)

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

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

ans = 0

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

if tmp != 1:
    factor.append(1)
if factor == []:
    factor.append(1)

for i in factor:
    j = 1
    while True:
        i -= j
        if i < 0:
            break
        j += 1
        ans += 1

print(ans)

Solution (Python):
import math

def answerCounter(N, i, answer):
    counter = 0
    power = 2
    sumPower = 1

    while N % i == 0:
        counter = counter + 1

        if sumPower == counter:
            answer = answer + 1
            sumPower = sumPower + power
            power = power + 1

        N = N // i

    return answer, N

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

    answer, N = answerCounter(N, 2, 0)

    for i in range(3, int(math.sqrt(N)) + 1, 2):
        answer, N = answerCounter(N, i, answer)

        if N < i:
            break

    if N > 2:
        answer, N = answerCounter(N, N, answer)

    print(answer)

if __name__ == "__main__":
    main()

Solution (Python):
import math

N=int(input())

ans=0
arr=[]

tmp=1



for i in range(int(math.sqrt(N))+5):
    tmp=1

    while N % ((i+2)**tmp) == 0:
        N=N / ((i+2)**tmp)
        
        ans+=1
        tmp+=1

    while N % (i+2) == 0:
        N = N // (i+2)

if N > 1 :
    ans+=1

print(ans)

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

A=[]
B=[]
X=0
for i in range(1,20):
    X+=i
    A.append(X)
    B.append(i)


A=A[::-1]
B=B[::-1]

D={}
for i in range(2,10**6+1):
    while N%i==0:
        if i not in D:
            D[i]=1
            N//=i
        else:
            D[i]+=1
            N//=i
if N>1:
    D[N]=1

ans=0
for k,v in D.items():
    for j in range(len(A)):
        if A[j]<=v:
            ans+=B[j]
            break
print(ans)

Solution (Python):
import sys
from collections import Counter
 
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60

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

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

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

L_f = prime_factorize(L)
for p in L_f.values():
    k = 1
    while p  >= k :
        p -= k
        k += 1
        ans += 1
print(ans)

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

index = 2
array = [0] * math.ceil(math.sqrt(n)+1)
while index <= math.sqrt(n):
  while n % index == 0:
    array[index] += 1 
    n //= index
    
  index += 1
  
ans = 0
if n >= len(array):
  ans += 1
elif n != 1:
  array[n] += 1
  
for i in range(len(array)):
  index = 1
  while index <= array[i]:
    array[i] -= index
    index += 1
    ans += 1
    
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)

for i in list(range(2,int(N**.5)+100)):
    while N>1 and N%i==0:
        N//=i
        lst[i]+=1
c=0
if N!=1:
    lst[N]+=1

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

Solution (Python):
import sys
from collections import Counter

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


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():
    N = int(readline())
    a = Counter(prime_factorize(N))

    ans = 0
    for power in a.values():
        ans += int(((1 + 8 * power) ** 0.5 - 1) / 2)

    print(ans)
    return


if __name__ == '__main__':
    main()

Solution (Python):



N = int(input())
if N==1:
    print(0)
else:
    
    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 num(n):
        if n==1:
            return 1
        cnt=0
        for i in range(50):
            cnt += i
            if n<=cnt-1:
                return i-1
    
    ans = 0

    for i in factorization(N):
        ans += num(i[1])
    print(ans)

Solution (Python):

import math

def prime_factorize(n):
    a = [] 
    a.append(1)
    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)
    
    b = [[],[]]
    cnt = 1
    for i in range(len(a)+1):
        if i > 0 and i < len(a):
            if a[i] == a[i-1]:
                cnt += 1
            else:
                b[0].append(a[i-1])
                b[1].append(cnt)
                cnt = 1
        if i == len(a) and i > 0:
            b[0].append(a[i-1])
            b[1].append(cnt)
        elif i == len(a) and i == 0:
            b[0].append(a[i])
            b[1].append(cnt)
    return b 


n = int(input())
a = prime_factorize(n)
ans = 0
for i in range(1, len(a[1])):
    ans += int((-1 + pow(1 + 8*a[1][i], 0.5)) / 2)
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

c = collections.Counter(prime_factorize(n))
A = list(c.values())

def dg(x):
    x = int(x)
    y = ((x * 8 + 1) ** (1 / 2) - 1) // 2
    return y

ans = 0
for v in A:
    ans += int(dg(v))

print(ans)

Solution (Python):
import itertools
import copy

N = int(input())




def prime_factor(n):
    ass = []
    for i in range(2,int(n**0.5)+1):
        while n % i==0:
            ass.append(i)
            n = n//i
    if n != 1:
        ass.append(n)
    return ass

pf = prime_factor(N)
if len(pf) == 0:
    print(0)
    exit()

d = {}
for i in pf:
    if i not in d:
        d[i] = 1
        continue
    d[i] += 1

exist_num = []
ans = 0
for k in d.keys():
    for c in range(1, 100):
        if d[k] >= c:
            exist_num.append(k ** c)
            ans += 1
            d[k] -= c
























print(ans)

Solution (Python):
import math

n=int(input())
cnt=0

for i in range(2,int(math.sqrt(n))+1):
  c=0
  while n%i==0:
    c+=1
    n//=i
  for j in range(1,c+1):
    c-=j
    if c<0:
      break
    cnt+=1
if n!=1:
  cnt+=1

print(cnt)

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

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

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

    return arr

a = int(input())
li = []
li = fact(a)
count = 0
i = 0
dif = 1

while i < len(li):
    if a == 1:
        break
    
    if li[i][1] >= dif:
        count += 1
        li[i][1] -= dif
        dif += 1
    else:
        dif = 1
        i += 1
print(count)