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 math

def trial_division(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 = trial_division(int(input()))

key = []
val = []

dupli = set()
for i in range(len(N)):
    if (not N[i] in dupli):
        key.append(N[i])
        dupli.add(N[i])

for i in range(len(key)):
    val.append(N.count(key[i]))


def maxvalue(n):
    if (n < 3):
        return 1
    elif (n < 6):
        return 2
    elif (n < 10):
        return 3
    elif (n < 15):
        return 4
    elif (n < 21):
        return 5
    elif (n < 28):
        return 6
    elif (n < 36):
        return 7
    elif (n < 45):
        return 8
    elif (n < 55):
        return 9
    elif (n < 66):
        return 10

sum = 0
for i in range(len(key)):
    sum += maxvalue(val[i])
    
    
    
    
    
    
    
    
    
    
    

print(sum)

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

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

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

    return arr

import itertools
import bisect
n = int(input())
if n == 1:
    print(0)
    exit()
arr = list(range(1, 50))
arr_sum = list(itertools.accumulate(arr))
ans = 0
for i in factorization(n):
    if i[1] in arr_sum:
        ans += (bisect.bisect_left(arr_sum, i[1])+1)
    else:
        ans += bisect.bisect_left(arr_sum, i[1])
print(ans)

Solution (Python):
import collections

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

yaku = factorize(N)
c = collections.Counter(yaku)

count = 0
for i in c.values():
    hoge = 1
    for j in range(2,10*5):
        if hoge <= i:
            hoge += j
            count += 1
        else:
            break

print(count)

Solution (Python):
import math
import sys
N = int(input())
temp = N
arr = []
if N == 1:
  print('0')
  sys.exit()
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])
sum = 0
for i in range(len(arr)):
  p = arr[i][1]
  q = 1
  while p > 0:
    p -= q
    if p >= 0:
      sum += 1
      q += 1
print(sum)

Solution (Python):
import math 
import itertools



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


def resolve(N):

    ans = 0
    factorize_N = factorize(N)

    if not factorize_N:
        print(0)
        return

    for key, value in itertools.groupby(factorize_N):
        count = len(list(value))
        for i in range(1, count + 1):
            count -= i
            if (count < 0):
                break
            ans += 1

    print(ans)


if __name__ == "__main__":
    n = int(input())
    resolve(n)

Solution (Python):
import math
import sys

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

N = int(input())
ans = factorization(N)
x = len(ans)
time = 0
count = 2
s = 1

if ans[0][0] == 1 :
    print(0)
    sys.exit()

for i in range(x) :
    while ans[i][1] >= s :
        time += 1
        s += count
        count += 1
    s = 1
    count = 2

print(time)

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

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

for i in c:
    p = i
    while (N%i==0):
        N /= i
        i *= p
        count += 1

    if (N == 1):
        break
        
print(count)

Solution (Python):
import itertools

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())
n_list = factorization(n)
cnt = 0
cnt_list = range(100)
cnt_list = list(itertools.accumulate(cnt_list))
for i in n_list:
    tmp = 0
    if i[0] != 1:
        for j in range(1, 100):
            if cnt_list[j] <= i[1]:
                tmp = j
            else:
                cnt += tmp
                break
print(cnt)

Solution (Python):
def factorize(n):
    ans = 0 
    b, e = 2, 0  
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            ans += int((-1 + (1+8*e)**(1/2))/2)
        b, e = b + 1, 0
    if n > 1:
        ans += 1
    return ans

N = int(input())
print(factorize(N))

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

l=factorization(n)

ans=0
now=n
if n==1:
  print(0)
else:
  for i,e in l:
    for j in range(1,e+1):
      if now%(i**j)==0:
        now=now//(i**j)
        ans+=1
  print(ans)

Solution (Python):
import sys

def input():
    return sys.stdin.readline()[:-1]

N = int(input())

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

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

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

    return arr

def func1(lst, value):
    return [i for i, x in enumerate(lst) if x <= value]

if N == 1:
	print(0)
else:
	
	ans_ = factorization(N)
	nums = []
	index_list = []
	
	ans = 0
	for i in range(1, 100):
		ans += i
		index_list.append(ans)
		
	for a in ans_:
		
		nums.append(a[1])
		
		
			
	ans = 0
	for i in nums:
		index = func1(index_list, i)
		
		ans += max(index)+1
	
	print(ans)

Solution (Python):
import sys
from collections import deque
import collections
import numpy as np

n = int(input())

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

def hantei(n):
    i = 0
    if n == 1 or n==2:
        return 1
    while (i+1)*i/2<=n:
        i+=1
    return i-1

c = collections.Counter(prime_factorize(n))
ans = 0


for i in c.values():
    
    ans += hantei(i)
print(ans)

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

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

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

    return arr
 
n = int(input())
numlist = factorization(n)
result = 0
for i in numlist:
    k = 0
    for j in range(n):
        if(k*(k+1)/2 > i[1]):
            k-=1
            break
        else:
            k+=1
    result+=k
if(n == 1 ):
    result = 0
print(result)

Solution (Python):
from collections import deque

m=int(input())
def fa(n):
    arr =deque([])
    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

x=0
count=0
for i,j in fa(m):
    
    for k in range(10**12):
        if j<k*(k+1)//2:
            x=k-1
            break
        elif j==k*(k+1)//2:
            x=k
            break
    count+=x


print(count)

Solution (Python):
import collections

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

countdict = {}
counter = 0

for i in range(1, 10):
    a = int(i*(i+1)/2)
    b = int((i+1)*(i+2)/2)
    for j in range(a, b):
        countdict[j] = i

N = int(input())
primelist = prime_decomposition(N)
primedic = collections.Counter(primelist)
result = 0

for i in primedic.values():
    result += countdict[i]
print(result)

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

if N == 1:
    print(0)
else:
    ans = 0
    for i in factorization(N):
        k = i[1]
        n = int((-1+(1+8*k)**(0.5))/2)
        ans += n
    print(ans)

Solution (Python):
def main():
    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)
    count = 0
    if A[0][0] != 1:
        for a in A:
            for i in range(a[1]):
                if a[1] - (i+1) >= 0:
                    a[1] = a[1] - (i+1)
                    count += 1
                else:
                    break
            
    print(count)
    
if __name__ == '__main__':
    main()

Solution (Python):
import collections
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
N = int(input())
c = collections.Counter(prime_factorize(N))
def getCount(w):
    i = 1
    n = 1
    while n <= w:
        i+=1
        n+=i
    return i - 1
cnt = 0
for v in c.values():
    cnt += getCount(v)
print(cnt)

Solution (Python):


def factorization(input):
    arr = []
    temp = input
    for i in range(2, int(-(-input**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([input, 1])

    return arr

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

element = []

for i in lst:
    for j in range(i[1]):
        element.append(i[0]**(j+1))

element = set(element)
element = sorted(list(element))



cnt = 0
for k in element:
    if (n % k !=0):
        
        
        continue
    n = n/k
    cnt += 1

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())
fact = factorization(n)

cnt = 0
for f in fact:
    fact_num = f[-1] 
    tmp = 1  
    while True:
        fact_num -= tmp
        
        if fact_num >= 0:
            cnt += 1
        else:
            break
        tmp += 1

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())
flag = 0
if N == 1:
    flag = -1
M = len(factorization(N))
num = [1,3,6,10,15,21,28,36]
ans = 0
for i in range(M):
    for j in range(len(num)):
        if num[j] <= factorization(N)[i][1]:
            ans += 1
        else:
            break

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

Solution (Python):
import math

n = int(input())
divs = []
for i in range(1, int(math.sqrt(n)) + 1):
    if n % i == 0:
        j = n // i
        if i != j:
            divs.append(j)
        divs.append(i)
divs.sort()

m = len(divs)
ans = 0
for i in range(1, m):
    z = divs[i]
    z2 = z
    prime = True
    for j in divs[1:i]:
        if z2 % j == 0:
            while z2 % j == 0:
                z2 //= j
            if z2 != 1:
                prime = False
    if prime:
        if n % z == 0:
            n //= z
            ans += 1
print(ans)

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

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

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

    return arr
  
N = int(input())
ans = factorization(N)
count = 0
for i in ans:
  if i[0] == 1:
    break
  for j in range(2,40):
    if i[1] < j*(j+1)/2:
      count += j-1
      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])

    return arr

def check(S):
    if S ==1:
      return 1
    elif S == 2:
      return 1
    elif S == 3:
      return 2
    else:
      for i in range(S):
        if i <= S:
          S -= i
        else:
          return i-1

if N != 1:
  result = factorization(N) 

  a = 0
  for r in result:
    b = check(r[1])
    a += b
  print(a)

else:
  print(0)

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

def countNewZ(count, countZ):
  current = (countZ * (countZ + 1)) / 2
  if(current <= count):
    countZ += 1
    return countNewZ(count, countZ)
  else:
    return countZ - 1

n = int(input())
primeFactors = prime_factors(n)
unique = set(primeFactors)
z = 0
for prime in unique:
  count = primeFactors.count(prime)
  z += countNewZ(count, 0)
print(z)

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

def getCount(w):
    i = 1
    n = 1
    while n <= w:
        i+=1
        n+=i
    return i - 1

cnt = 0

for v in c.values():
    cnt += getCount(v)

print(cnt)

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

def count_n(x):
    n=1
    while True:
        m=(1+n)*n/2
        if m>x:
            n-=1
            break
        n+=1
    return n


c = collections.Counter(prime_factorize(N))
d = c.values()
co=0
for i in d:
    co+=count_n(i)

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

Solution (Python):

import sys,math
input = sys.stdin.readline
n = int(input())

a = []
tmp = n
for i in range(2, int(n**0.5//1)+1):
  if tmp%i==0:
    count = 0
    while tmp%i==0:
      count += 1
      tmp //=i
    a.append([i, count])
if tmp!=1:
  a.append([tmp,1])
if a==[]:
  if n==1:
    print(0)
    sys.exit()
  else:
    
    print(1)
    sys.exit()
  


r = [k[1] for k in a]
ans = 0
for i in r:
  j = 1
  t = i
  while t>=j:
    ans += 1
    t -= j
    j += 1
print(ans)

Solution (Python):
import numpy as np

def is_prime(a):
  if a == 1:
    return False
  
  for i in range(2, 1+int(a**0.5)):
    if a % i == 0:
      return False
  return True

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]

n = int(input())

ans = 0
divisors = make_divisors(n)
for d in divisors[1:]:
  if d > n:
    break
  if is_prime(n):
    ans += 1
    break
    
  tmp_divisors = make_divisors(d)
  for p in tmp_divisors[1:]:
    if not is_prime(p):
      continue
    tmp = np.log(d)/np.log(p)
    if tmp > 0 and tmp == int(tmp) and n % d == 0:
      n = n/d
      ans += 1
      break

print(ans)

Solution (Python):
import math
def main():

    N = int(input())
    primes = []
    def isprime(n):
        if n == 1: return False
        for i in range(2, int(math.sqrt(n))+1):
            if n % i == 0:
                return False
        return True

    primes = set()
    for i in range(1, int(math.sqrt(N))+1):
        if N % i == 0:
            if isprime(i):
                primes.add(i)
            if isprime(N//i):
                primes.add(N//i)
    if isprime(N):
        primes.add(N)

    ans = 0
    for p in primes:
        q = p
        while N % q == 0:
            ans += 1
            N //= q
            q *= p
        if N == 1:
            break
    return ans


if __name__ == '__main__':
    print(main())

Solution (Python):

import sys

def fact(n):
    a=[]
    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
            a.append(cnt)
    if tmp!=1:
        a.append(1)
    if a==[]:
        a.append(1)
    return a

def solve(N: int):
    if N==1:
        print(0)
        sys.exit()

    a=fact(N)

    ans=0
    for i in a:
        nz=i
        k=1
        while True:
            if nz>=k:
                nz-=k
                k+=1
                ans+=1
            else:
                break

    print(ans)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)

if __name__ == '__main__':
    main()

Solution (Python):




























def soinsubunkai(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())
    if N == 1:
        return 0
    
    N_ = N

    
    

    
    

    
    
    
    
    
    

    
    
    
    
    
    
    
    
    
    

    soinsu_ = soinsubunkai(N)
    soinsu = {}
    for k, v in soinsu_:
        soinsu[k] = v
    
    
    
    

    counts = {}
    for cnt in soinsu.values():
        if cnt not in counts:
            counts[cnt] = 1
        else:
            counts[cnt] += 1
    

    ans = 0
    for k, v in counts.items():
        for n in range(int((2*k+0.25)**0.5) + 1, -1, -1):
            if n*(n+1) <= 2*k < (n+1)*(n+2):
                ans += n*v
                break
    
    return ans


print(main())

Solution (Python):

n=int(input()) 
pf={}
for i in range(2,int(n**0.5)+1):
    while n%i==0:
        pf[i]=pf.get(i,0)+1
        n//=i
if n>1:pf[n]=1


cnt = 1
ans = 0
for i in pf.values():
    tmp = i
    while tmp >= cnt: 
        ans += 1
        tmp = tmp - cnt
        cnt += 1
    cnt = 1
print(ans)

Solution (Python):
inp = list(map(int, input().split()))


def factorize(n):
    arr = []
    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
            arr.append([i, cnt])

    if tmp != 1:
        arr.append((tmp, 1))

    if not arr and n != 1:
        arr.append((n, 1))

    return arr


re = 0

for _, c in factorize(inp[0]):
    tmp1 = c
    tmp2 = 1
    while tmp1 >= tmp2:
        re += 1
        tmp1 -= tmp2
        tmp2 += 1


print(re)

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

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

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

    return arr

n = int(input())
if(n == 1):
  print(0)
  exit()
a = factorization(n) 
sum = 0
for i in a:
  m = i[1]
  s = 1
  while(m >= s):
    sum += 1
    m -= s
    s += 1
    
print(sum)

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

if __name__ == "__main__":
    N = int(input())
    c = collections.Counter(prime_factorize(N))
    l = list(c.values())
    counter = 0
    for f in l:
        num = 1
        while f >= num:
            f -= num
            num += 1
            counter += 1
    print(counter)

Solution (Python):
from sys import stdin
import math

a=int(stdin.readline())
PP=0
K=0

if a==1:
    print(0)
    K=1
L=list()


for b in range(2,int(math.floor(math.sqrt(a)))+1):
    count=0
    if a%b==0:
        while a%b==0:
            count+=1
            a=a/b
    if count>0:
       L.append(count)


if len(L)==0 and K==0:
    print(1)
    PP=1

if a!=1:
    L.append(1)

sum=0

for k in range(0,len(L)):
    p=L[k]
    sum+=int(math.floor((-1+math.sqrt(1+8*p))/2))


if PP==0 and K==0:
   print(sum)

Solution (Python):
def p(n):
    a=[]
    while n%2==0:
        a.append(2)
        n//=2
    f=3
    while f*f<=n:
        if n%f==0:
            a.append(f)
            n//=f
        else:
            f+=2
    if n!=1:
        a.append(n)
    return a
n=int(input())
a=p(n)
d={}
for i in a:
  d[i]=d.get(i,0)+1
b=list(d.values())
ans=0
d=[0]*50
for i in range(1,50):
    d[i]=d[i-1]+i
for i in b:
    c=sum(j<=i for j in d)-1
    ans+=c    
print(ans)

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

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

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

    return arr
if n == 1:
    print(0)
elif len(prime_factorization(n)) == 1 and prime_factorization(n)[0][1] == 1:
    print(1)
else:
    ans = 0
    prime_list = prime_factorization(n)
    
    for i in prime_list:
        a = i[1]
        sub = 1
        j = 0
        while True:
            if a < sub:
                break
            a -= sub
            sub += 1
            j += 1
            
        
        
        ans += j
        
    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())
from collections import Counter

def check(v):
    an = 0
    i = 1
    subsum = 0
    while v - subsum >= i:
        subsum += i
        i += 1
        an += 1
    return an



def Main(N):
    p = prime_factorize(N)
    c = Counter(p)
    ans = 0
    for v in c.values():
        ans += check(v)
    return ans

print(Main(N))

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())
count = 0
j = 1

c = collections.Counter(prime_factorize(N))
factor_sets = list(c.items())

fac_num = len(factor_sets)

for i in range(fac_num):
    while True:
        if (j + 1) * (j + 2) / 2 <= factor_sets[i][1]:
            j += 1
        else:
            count += j
            j = 1
            break

print(count)

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

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

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

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

    return arr
if n == 1:
    print(0)
    exit()
li = factorization(n)
for i in li:
    ii = i[0]
    loop = True
    while(loop):
        if n % ii == 0:
            n = n / ii
            cnt += 1
            ii *= i[0]
        else:
            loop = False
print(cnt)

Solution (Python):
a=int(input())
ans =0


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
b = factorization(a)
for i in range(len(b)):
    count=0
    c = b[i][1]

    for j in range(1,40):
        if c - j >= 0:
            c -= j
            count += 1
        else:
            ans += count
            break
if a ==1:
    print(0)
else:
    print(ans)

Solution (Python):
from collections import deque

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())
    fact = factorization(N)
    ans = 0

    if N == 1:
        print(0)
        return

    kasuus = [f[0] for f in fact]
    sisuus = [f[1] for f in fact]
    ks = deque(kasuus)
    ss = deque(sisuus)

    while ss:
        sisuu = ss.popleft()
        cnt = 1
        while True:
            sisuu -= cnt
            if sisuu < 0:
                break
            else:
                ans += 1
                cnt += 1

    print(ans)

    


if __name__ == "__main__":
    main()