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
input = sys.stdin.readline


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():
    N = int(input())
    answer = 0
    ans_list = factorization(N)
    sum_list = [1, 3, 6, 10, 15, 21, 28, 36, 45]
    if N == 1:
        print(0)
        exit()
    for i in ans_list:
        for j in range(len(sum_list)):
            if i[1] < sum_list[j]:
                answer += j
                break
    print(answer)


if __name__ == '__main__':
    main()

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

count = 0
for i in a.values():
    for j in range(1,1000000):
        if i - j >= 0:
            count += 1
            i -= j
        else:
            break
print(count)

Solution (Python):

def prime_factorization(N):
    ans = []
    if N==1:
        return [[1,0]]
    a = 2
    count = 0
    t = N
    while a*a<=t:
        if N%a!=0:
            a = a + 1
            count = 0
            continue
        while N%a==0:
            count = count + 1
            N = N//a
        ans.append([a, count])
        a = a + 1
        count = 0
    if (N!=1):
        ans.append([N,1])
    return ans
e = 0
def dfs(N, n, sum):
    global e
    if N<sum:
        e = e - 1
        return
    e = e + 1
    dfs(N, n+1, sum+n)

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

ans = 0

for a,b in L:
   e = 0
   dfs(b, 1, 0)
   ans = ans + e

print(ans)

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

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

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

    return arr
if(N==1):
    print(0)
else:
    prime_factor=factorization(N) 
    nrow=len(prime_factor)
    n=0
    for i in range(nrow):
        order=prime_factor[i][1]
        n+=math.floor((-1.0+math.sqrt(1.0+8.0*order))/2.0)
    print(n)

Solution (Python):
import math
n = int(input())
if n == 1:
  print(0)
  exit()

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

ans = 0
for i in arr:
  if i[1] == 1 or i[1] == 2:
    ans += 1
  else:
    ans = ans + int(-1/2 + math.sqrt(1+8*i[1])/2)
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

n = int(input())
res = prime_factorize(n)
if len(res) == 1:
  print(1)
else:
  cnt = 0
  c = None
  p = 0
  l = set()
  for r in res:
    if c == r:
      p += 1
      if not p in l:
        l.add(p)
        p = 0
        cnt += 1
    else:
      l.clear()
      p = 0
      l.add(1)
      cnt += 1
      c = r
  print(cnt)

Solution (Python):
from math import sqrt
def factorint(n):
    d = {}
    for i in range(2, int(sqrt(n))+1):
        c = 0
        q, r = divmod(n, i)
        while not r:
            c += 1
            n = q
            q, r = divmod(n, i)
        if c:
            d[i] = c
    if n != 1:
        d[n] = 1
    return d

n = int(input())
if n == 1:
    print(0)
else:
    d = factorint(n)
    s = 0
    for v in d.values():
        s += int((sqrt(8*v+1)-1)/2)
    print(s)

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

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

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

    return arr

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

        fac = factorization(N)

        arr = []

        for i in range(len(fac)):
                for j in range(fac[i][1]):
                        temp = fac[i][0]**(j+1)
                        arr.append(temp)

        arr.sort()

        count = 0

        for i in range(len(arr)):
                if N==1:
                        break
                else:
                        if N%arr[i]==0:
                                N = N/arr[i]
                                count += 1

        return count

if __name__=="__main__":
        ans = main()
        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 sys
inp = int(input())
x=prime_factorize(inp)
a=0
xset = set(x)
for i in xset:
  z=x.count(i)
  a+=1
  n=2
  ar=(n*(n+1))/2
  while z>=ar:
    a+=1
    n+=1
    ar=(n*(n+1))/2
print(a)

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

  
N = int(input())
factor = pfactor(N)
ans = 0

for p in set(factor):
    i = factor.count(p)
    while i > 0:
        c = (1 + 8*i) ** 0.5
        if c.is_integer():
            ans += (int(c)-1) // 2
            break
        i -= 1

print(ans)

Solution (Python):

import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def primeFactors(n):
    facs = defaultdict(int)
    
    while n % 2 == 0:
        facs[2]+=1
        n = n / 2

    
    
    for i in range(3, int(sqrt(n)) + 1, 2):

        
        while n % i == 0:
            facs[i]+=1
            n = n / i

            
    
    if n > 2:
        facs[n]+=1

    return facs

n = INT()

factors = primeFactors(n)

canBe = []

for el in factors:
    for po in range(1, 60):
        if(factors[el]<=0):
            break
        canBe.append(int(el**po))
        factors[el]-=1


canBe.sort()
i = 0
ans = 0

while (True):
    if (i >= len(canBe) or canBe[i] > n):
        break
    if(n/canBe[i]==n//canBe[i]):
        n /= canBe[i]
        ans += 1
    i += 1
    
print(ans)

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

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


arr=prime_factorize(N)
kaisu=0




while(len(arr)>0):
	

	minval = min(arr)
	c=arr.count(minval)
	lp=c
	
	for i in range(1,lp+1):
		
		if c >= i:
			c-=i
			kaisu+=1
			
		arr.remove(minval)

print(kaisu)

Solution (Python):
import math

def primeFactors(n): 
	  
	
	d = {}
	while n % 2 == 0: 
	    
	    
	    if(2 not in d):
	    	d[2] = 1
	    else:
	    	d[2]+=1
	    n = n / 2
	      
	
	
	for i in range(3,int(math.sqrt(n))+1,2): 
	      
	    
	    while n % i== 0: 
	        
	        
	        if(i not in d):
	        	d[i] = 1
	        else:
	        	d[i]+=1
	        n = n / i 
	          
	
	
	if n > 2: 
	    
	    
	    if(n not in d):
	    	d[n] = 1
	    else:
	    	d[n]+=1
	return d

n = int(input())

d = primeFactors(n)
if(not d):
	print(0)
else:
	ans = 0
	for i in d:
		if(d[i] == 1):
			ans+=1
		else:
			ans += int((-1 + math.sqrt(1 + 8 * d[i])) // 2);

	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

F = factorization(n)

cnt = 0 
for i in range(len(F)):
  m = 1
  while F[i][1] >= m*(m+1)/2:
    cnt += 1
    m += 1

print(cnt)

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

whole = factorization(n)

count = 0

if whole == [[1, 1]]:
  print(count)
  exit()


for s in whole:
  
  c = 0
  for i in range(1, s[1] + 1):
    shou = n / (int(s[0]) ** (i * (i + 1) / 2))
    seisuu = n // (int(s[0]) ** (i * (i + 1) / 2))
    if shou == seisuu:
      
      c += 1
    else:
      break
  count += c

print(count)

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 is_prime(n):
    for d in range(2, math.floor(math.sqrt(n)) + 1):
        if n % d == 0:
            return False
    return True


N = int(input())
if N == 1:
    print(0)
elif is_prime(N):
    print(1)
else:
    res = 0
    for _, count in factorization(N):
        if count <= 2:
            res += 1
        else:
            i = 1
            while count - i >= 0:
                count -= i
                i += 1
            res += (i - 1)
    print(res)

Solution (Python):
import collections

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

number = list(c.values())
ans = 0
for i in number:
    step = 1
    key = 1
    while key <= i:
        ans += 1
        step += 1
        key += step

print(ans)

Solution (Python):
from collections import defaultdict

def pr(n):
    d = defaultdict(lambda:0)
    i = 2
    while (n > 1) and (i < int(n**0.5)+1):
        if n % i == 0:
            d[i] += 1
            n //= i
        else:
            i += 1
            
    if n > 1:
        d[n] += 1
    return d

def t(x):
    i = 1
    while x >= i:
        x -= i
        i += 1
    return i-1

n = int(input())
d = pr(n)
r = 0
for i in d.values():
    r += t(i)
print(r)

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))
d = list(c.values())
ans = 0
for j in range(len(d)):
  for i in range(1,40):
    k = i*(i+1)/2
    if d[j] == k:
      ans += i
      break
    elif d[j] < k:
      ans += i-1
      break
    else:
      continue
print(ans)

Solution (Python):
import collections
N = int(input())
counter = 0
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

def cc(n):
    ans = 0
    i = 1
    while True:
        n = n - i
        ans += 1
        i += 1
        if n < i:
            break
    return ans

s_list = prime_factorize(N)
c = collections.Counter(s_list)
values,counts = zip(*c.most_common())
j = 0
for i in range(len(counts)):
    counter += cc(counts[i])
print(counter)

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())
A = factorization(N)
n = len(A)
sum = 0
if N ==1:
    print(0)
else:
    for i in range(n):
        d =A[i][1]
        for j in range(100):
            if j*(j+1) <= 2*d < (j+1)*(j+2):
                sum = sum + j
                break
    print(sum)

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

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

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

    return ans

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


print(factorization(N))

Solution (Python):
a=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
ww=factorization(a)
ans=0
if a==1:
    ans=0
else:
    for j in range(len(ww)):
        if 2>=ww[j][1]>=1:
            ans+=1
        if 5>=ww[j][1]>=3:
            ans+=2
        if 9>=ww[j][1]>=6:
            ans+=3 
        if 14>=ww[j][1]>=10:
            ans+=4
        if 20>=ww[j][1]>=15:
            ans+=5
        if 27>=ww[j][1]>=21:
            ans+=6
        if 35>=ww[j][1]>=28:
            ans+=7
        if ww[j][1]>=36:
            ans+=8
print(ans)

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

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

l=[]
ans=0
for i in range(2,int(N**0.5)+1):
    cnt=0
    while N % i ==0:
        cnt+=1
        N //=i
    if cnt > 0:
        l.append( (i,cnt) )
        ans += int( (-1+(1+8*cnt)**0.5)/2 )
if N > 1:
    l.append((N,1))
    ans +=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

prime_list=prime_factorize(N)
prime_dict=collections.Counter(prime_list)
ans=0

for k,v in prime_dict.items():
    cnt=1
    if v <= 2:
        ans += 1
    else:
        while (cnt <= v):
            v = v - cnt
            cnt += 1
            ans += 1

print(ans)

Solution (Python):
import random

def primesbelow(N):
    
    
    correction = N % 6 > 1
    N = {0:N, 1:N-1, 2:N+4, 3:N+3, 4:N+2, 5:N+1}[N%6]
    sieve = [True] * (N // 3)
    sieve[0] = False
    for i in range(int(N ** .5) // 3 + 1):
        if sieve[i]:
            k = (3 * i + 1) | 1
            sieve[k*k // 3::2*k] = [False] * ((N//6 - (k*k)//6 - 1)//k + 1)
            sieve[(k*k + 4*k - 2*k*(i%2)) // 3::2*k] = [False] * ((N // 6 - (k*k + 4*k - 2*k*(i%2))//6 - 1) // k + 1)
    return [2, 3] + [(3 * i + 1) | 1 for i in range(1, N//3 - correction) if sieve[i]]

smallprimeset = set(primesbelow(100000))
_smallprimeset = 100000
def isprime(n, precision=7):
    
    if n < 1:
        raise ValueError("Out of bounds, first argument must be > 0")
    elif n <= 3:
        return n >= 2
    elif n % 2 == 0:
        return False
    elif n < _smallprimeset:
        return n in smallprimeset


    d = n - 1
    s = 0
    while d % 2 == 0:
        d //= 2
        s += 1

    for repeat in range(precision):
        a = random.randrange(2, n - 2)
        x = pow(a, d, n)

        if x == 1 or x == n - 1: continue

        for r in range(s - 1):
            x = pow(x, 2, n)
            if x == 1: return False
            if x == n - 1: break
        else: return False

    return True


def pollard_brent(n):
    if n % 2 == 0: return 2
    if n % 3 == 0: return 3

    y, c, m = random.randint(1, n-1), random.randint(1, n-1), random.randint(1, n-1)
    g, r, q = 1, 1, 1
    while g == 1:
        x = y
        for i in range(r):
            y = (pow(y, 2, n) + c) % n

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

    return g

smallprimes = primesbelow(1000) 
def primefactors(n, sort=False):
    factors = []

    for checker in smallprimes:
        while n % checker == 0:
            factors.append(checker)
            n //= checker
        if checker > n: break

    if n < 2: return factors

    while n > 1:
        if isprime(n):
            factors.append(n)
            break
        factor = pollard_brent(n) 
        factors.extend(primefactors(factor)) 
        n //= factor

    if sort: factors.sort()

    return factors

def factorization(n):
    factors = {}
    for p1 in primefactors(n):
        try:
            factors[p1] += 1
        except KeyError:
            factors[p1] = 1
    return factors

totients = {}
def totient(n):
    if n == 0: return 1

    try: return totients[n]
    except KeyError: pass

    tot = 1
    for p, exp in factorization(n).items():
        tot *= (p - 1)  *  p ** (exp - 1)

    totients[n] = tot
    return tot

def gcd(a, b):
    if a == b: return a
    while b > 0: a, b = b, a % b
    return a

def lcm(a, b):
    return abs((a // gcd(a, b)) * b)
l=[0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0]
N=int(input())
choice=0
x=0
ans=0
dic=factorization(N)

for key in dic.keys():
  ans+=l[dic[key]]
print(ans)

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

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

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

  return arr

import sys

z = int(input())
dividers = factorization(z)


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

else:
  ans = 0
  for divider in dividers:
    i = 0
    while i*(i+1)/2 <= divider[1]:
      i += 1
    ans += i - 1

print(ans)

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

factors = []

rem = 1
while n%2 == 0:
    n //= 2
    rem *=2
    if not rem in factors:
        factors.append(rem)
        rem = 1

for f in range(3, int(n**0.5)+ 1, 2):
    rem = 1
    while n%f == 0:
        n //= f
        rem *= f
        if not rem in factors:
            factors.append(rem)
            rem = 1

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

print(len(factors))

Solution (Python):
import math
def D():
    N = int(input())
    if N == 1:
        print(0)
        return
    temp = N
    count = 0
    while temp % 2 == 0: 
       temp //= 2
       count += 1
    track = 1
    
    while count-track >= 0:
        count -= track
        track += 1
    
    ans = track - 1
    for i in range(3,int(math.sqrt(temp))+1,2): 
        count = 0
        while temp % i== 0: 
            temp //= i
            count += 1
        track = 1
        while count-track >= 0:
            count -= track
            track += 1
        ans += track - 1
    if temp > 2:
        ans += 1
    print(ans)
D()

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

def prime_factorize( n ):
    a = {}
    while n % 2 == 0:
        try:
            a[ 2 ] += 1
        except KeyError:
            a[ 2 ] = 1
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            try:
                a[ f ] += 1
            except KeyError:
                a[ f ] = 1
            n //= f
        else:
            f += 2
    if n != 1:
        try:
            a[ n ] += 1
        except KeyError:
            a[ n ] = 1
    return a

a = prime_factorize( n )
ans = 0
for p in a.keys():
    ans += int( ( -1 + math.sqrt( 1 + 8 * a[ p ] ) ) / 2 )

print( ans )

Solution (Python):
import math
from bisect import bisect


def primeFactors(n):
    ar = []
    for i in range(1, 101):
        ar.append(i * (i + 1) // 2)
    d = dict()
    while n % 2 == 0:
        if d.get(2) is None:
            d[2] = 1
        else:
            d[2] += 1
        n = n // 2
    for i in range(3, int(math.sqrt(n)) + 1, 2):
        while n % i == 0:
            if d.get(i) is None:
                d[i] = 1
            else:
                d[i] += 1
            n = n // i
    if n > 2:
        d[n] = 1
    cnt = 0
    for i in d.values():
        if i == 1:
            cnt += 1
        else:
            b = bisect(ar, i)
            cnt += b
    return cnt


print(primeFactors(int(input())))

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 

def ii(): return int(sys.stdin.readline().rstrip()) 
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) 
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]

def ss(): return sys.stdin.readline().rstrip() 
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) 
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]





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



res = []
x = n

y = 2
while y*y <= x:
    while x % y == 0:
        res.append(y)
        x //= y
    y += 1
if x > 1:
    res.append(x)



dic=Counter(res)
ans=0

for i in dic:
    p=dic[i]
    
    chk=0
    cnt=0
    for q in range(1,24):
        if chk+q<=p:
            cnt+=1
            chk+=q
        
        
    ans+=cnt
    
print(ans)

Solution (Python):

import sys
import numpy as np

input = sys.stdin.readline


def S():
    return input().rstrip()


def I():
    return int(input())


def MI():
    return map(int, 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


n = I()
result = factorization(n)

a = np.arange(1, 10)
a = np.cumsum(a)

if n == 1:
    print("0")
    exit()
else:
    ans = 0
    for l in result:
        ans += len(a[a <= l[1]])

print(ans)

Solution (Python):
from sys import stdin
from math import sqrt
input = stdin.readline
N = int(input())

s = [0] * (int(sqrt(N)) + 1)

ans = 0

for i in range(2, int(sqrt(N)) + 1):
    tmp = i

    while N % tmp == 0:
        N //= tmp
        s[tmp] += 1

for i in s:
    for j in range(10 ** 5):
        if (j * (j + 1)) // 2 > i:
            k = j
            break

    ans += k - 1

for i in range(2, int(sqrt(N)) + 1):
    if N % i == 0:
        print(ans)
        exit()

if N != 1:
    ans += 1


print(ans)

Solution (Python):

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


def q4():
    N = int(input())
    arr = prime_factorize(N)
    if not arr:
        print(0)
        return

    ans_count = 0
    count = 1

    min_val = min(arr)
    while arr:
        if arr.count(min_val) < count:
            arr = list(filter(lambda a: a != min_val, arr))
            count = 1
            if not arr:
                break
            min_val = min(arr)
            continue
        arr = arr[count:]
        ans_count += 1
        count += 1
    print(ans_count)


q4()

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



dic = prime_factorize(n)



list_keys = list(dic.keys())

cnt = 0
for key in list_keys:
    c = 1
    while True:
        dic[key] -= c
        c += 1
        cnt += 1
        if dic[key] < c:
            break

print(cnt)

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


def prime_len(n):
    a = set()
    while n % 2 == 0:
        a.add(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.add(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.add(n)
    return len(a)


n = int(input())
c = 0
for z in make_divisors(n):
    if prime_len(z) == 1:
        tmp = n / z
        if tmp.is_integer():
            n = tmp
            c += 1
        else:
            continue

print(c)

Solution (Python):
import math
n = int(input())
n1 = n
if n == 1:
    print(0)
else:
    a = [0]*(int(math.sqrt(n)) + 1)
    a[1] = 1
    ans = 0
    for i in range(2, int(math.sqrt(n)) + 1):
        if a[i] == 0:
            for j in range(i+i, int(math.sqrt(n)) + 1, i):
                a[j] = 1
    for i in range(2, len(a)):
        if a[i] == 0:
            k = 1
            s = i
            while n % s == 0:
                
                ans += 1
                n //= s
                s *= i
            while n % i == 0:
                n //= i
    
    f = 1
    for j in range(2, int(math.sqrt(n)) + 2):
        if n % j == 0:
            f = 0
            break
    if f and n != 1:
        ans += f
    

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

Solution (Python):
N=int(input())
def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct
a=factorize(N)

q={}
for i in range(len(a)):
  if a[i] in q:
    q[a[i]]+=1
  else:
    q[a[i]]=1
def k(n):
    B=[i*(i+1) for i in range(20)]
    s=0
    for j in range(20):
      if 2*n>=B[j]:
        s=j
      else:
        s=s
    return s
c=0
for key in q.keys():
  c+=k(q[key])
print(c)

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

def isPrime(n):
    i = 2
    while i * i <= n:
        if n % i == 0:
            return False
        i += 1
    return True

def f(n):
    if n == 0:
        return 0
    i = 1
    while not(i * (i + 1) // 2 <= n and n < (i + 1) * (i + 2) // 2):
        i += 1
    return i

p = {}

answer = 0
if n % 2 == 0:
    c = 0
    while n % 2 == 0:
        n //= 2
        c += 1
    answer += f(c)

q = 3
while q * q <= n:
    c = 0
    while n % q == 0:
        n //= q
        c += 1
    answer += f(c)
    q += 2

if n > 1:
    answer += 1
print(answer)

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())
fact = factorization(N)
ans = 0
for f in fact:
    if f[0] >= 2:
        remain = f[1]
        tmp = 1
        while True:
            remain -= tmp
            if remain >= 0:
                ans += 1
            else:
                break
            tmp += 1
print(ans)