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
N = int(input())
def make_prime_list_2(num):
    if num < 2:
        return []
    
    prime_list = [i for i in range(num + 1)]
    prime_list[1] = 0 
    num_sqrt = math.sqrt(num)

    for prime in prime_list:
        if prime == 0:
            continue
        if prime > num_sqrt:
            break

        for non_prime in range(2 * prime, num, prime):
            prime_list[non_prime] = 0

    return [prime for prime in prime_list if prime != 0]

def prime_factorization_2(num):
    if num <= 1:
        return {1: 1}
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = make_prime_list_2(num_sqrt)

        dict_counter = {}
        for prime in prime_list:
            while num % prime == 0:
                if prime in dict_counter:
                    dict_counter[prime] += 1
                else:
                    dict_counter[prime] = 1
                num //= prime
        if num != 1:
            if num in dict_counter:
                dict_counter[num] += 1
            else:
                dict_counter[num] = 1

        return dict_counter

dict = prime_factorization_2(N)
lst = list(dict.values())

res = 0
for i in range(1,(N//2)+1):
    for j in range(len(lst)):
        if lst[j] >= i:
            lst[j] = lst[j] - i
            res += 1
    if all(k <= i for k in lst):
        break

print(res)

Solution (Python):
import collections

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


n = int(input())

itm = collections.Counter(prime_factorize(n))

ans = 0

for i in itm.keys():
    num = 1
    while True:
        if itm[i] - num < 0:
            break
        else:
            ans+=1
            itm[i] -= num
            num += 1

counter = 0

for i in itm.keys():
    if itm[i] != 0:
        counter += 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())
fac_list=factorization(N)
if fac_list[0][0]==1:
  print(0)
else:
  ans=0
  for i in range(len(fac_list)):
    temp=fac_list[i][1]
    j=1
    while temp>=j:
      temp-=j
      ans+=1
      j+=1
  print(ans)

Solution (Python):
import copy
from collections import defaultdict

N = int(input())
tmp = copy.copy(N)
d = defaultdict(int)
if N == 1:
    print(0)
    exit()
for i in range(2, int(N ** 0.5) + 3):
    while N % i == 0:
        N //= i
        d[i] += 1
if N > 1:
    d[N] += 1
ans = 0
for i in d.values():
    tmp = 1
    while i - tmp >= 0:
        i -= tmp
        tmp += 1
        ans += 1
print(ans)

Solution (Python):

import sys

from functools import reduce

import math

def is_prime(n):
    if n % 2 == 0 and n > 2: 
        return False
    for i in range(3, int(math.sqrt(n)) + 1, 2):
        if n % i == 0:
            return False
    return True

def sieve(n):
    n=int(n)
    
    
    
    prime = [True for i in range(n + 1)] 
    p = 2
    while (p * p <= n): 
          
        
        if (prime[p] == True): 
              
            
            for i in range(p * 2, n + 1, p): 
                prime[i] = False
        p += 1
    prime[0]= False
    prime[1]= False

    return [i for i, p in enumerate(prime) if p]

def inthroot(x,n):
    "calculate floor(x**(1/n))"
    return math.floor(x**(1/n))

def is_a_power(n):
    "return (a,b) if n=a**b otherwise throw ValueError"
    for b in sieve( math.log2(n) +1 ):
        if b == 0:
            raise ValueError
            
        a = inthroot(n,b)
        if a**b == n:
            return a,b
    raise ValueError
    


def smooth_factorization(n):
    "return (p,e) where p is prime and n = p**e if such value exists, otherwise throw ValueError"
    e=1
    p=n
    while True:
        try:
            p,n = is_a_power(p)
            e = e*n
        except ValueError:
            break
    if is_prime(p): 
        return p,e


def factors(n):
    return set(
        reduce(
            list.__add__,
            ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0),
        )
    )
        
def solve(N: int):
    count = 0
    picked_z = set([])

    while True:
        zs = list(factors(N))
        zs.remove(1)

        for _ in range(len(zs)):
                    
            z = min(zs)
            i = zs.index(z)

            is_prime_power = smooth_factorization(z)
            if is_prime_power and z not in picked_z:
                picked_z.add(z)
                N = N / z
                count += 1
                del zs[i]
                break

            del zs[i]

        if len(zs) == 0:
            break

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

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

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

    return arr
N = int(input())
ans = 0
if N != 1:
    fact_list = factorization(N)
    for _, i in fact_list:
        j = 1
        while i >= j:
            ans += 1
            i = i - j
            j += 1
            
print(ans)

Solution (Python):
def fact(n):
    p_factors = []

    for i in range(2, int(n**0.5)+1):
        while n%i == 0:
            p_factors.append(i)
            n //= i
    if n>1:
        p_factors.append(n)
    return p_factors



n = int(input())

factors = fact(n)

factors_set = set(factors)


nums = []
for i in factors_set:
    nums.append(factors.count(i))



count = 0
for i in nums:
    temp = i
    j = 1
    while True:
        temp -= j
        if temp < 0:
            break
        count += 1
        j += 1

print(count)

Solution (Python):

"""
Created on Sun May 31 21:31:49 2020

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

    if temp!=1:
        arr.append(1)

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

    return arr


if __name__ == "__main__":
    N = int(input())
    if N == 1:
        print(0)
    else:
        b = factorization(N)
        ans = 0
        for i in range(0, len(b)):
            j = 1
            while b[i] - j >= 0:
                b[i] = b[i] - j
                j += 1
                ans += 1
        print(ans)

Solution (Python):
from functools import reduce
from decimal import *
from operator import mul

def main():
    n = int(input())
    p = prime_factorize(n)
    sa = list(sorted(p))
    pp = []
    num = 1
    for i, v in enumerate(sa):
        if i > 0 and sa[i-1] != v:
            num = 1
        num *= v
        if num not in pp and n % num == 0:
            pp.append(num)
            num = 1
    print(len(pp))

def input_list():
    return list(map(int, input().split()))

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__':
    main()

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

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

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

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

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

    return arr

s = factorization(n)

ans = 0
for i in s:
    tmp = 0
    c = 0
    while True:
        c += 1
        tmp += c
        if tmp > i[1]:
            break
    ans += c-1
print(ans)

Solution (Python):
from collections import defaultdict
n = int(input())

def soinsu(n):
    for i in range(2, int(n ** 0.5) + 1):
        while n % i == 0:
            n //= i
            S[i] += 1
    if S == {}:
        S[n]+=1
    else:
        if n != 1:
            S[n] += 1
    return S


if n==1:
    print(0)
else:
    S = defaultdict(int)
    S=soinsu(n)
    r=0
    for k,v in S.items():
        i=1
        while v>=i:
            v-=i
            r+=1
            i+=1
    print(r)

Solution (Python):
import math

n=int(input())

if n==1:
    ans=0

else:
    
    temp=n
    sqn=int(math.sqrt(temp))
    soinsu=[]
    
    for i in range(2,sqn+1):
        count=0
        while temp%i==0:
            temp%i==0
            temp=temp//i
            count+=1
        if count!=0:
            soinsu.append([i,count])

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

            
    ans=0
    for i in range(len(soinsu)):
        ans+=int((-1+math.sqrt(1+8*soinsu[i][1]))/2)



print(ans)

Solution (Python):
import sys
input = sys.stdin.readline

def get_sieve_of_eratosthenes_new(n):
    import math
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 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

def get_count(beki) :
    count = 0
    for i in range(1,beki+1) :
        tmp = beki - i
        if (0 <= tmp) :
            count += 1
            beki = tmp
        else :
            return count
    
    return 1

def main() :
    N = int(input())
    count = 0
    if (N == 1) :
        print(0)
        return

    factorized = factorization(N)
    
    for fact in factorized :
        fact_c = fact[1]
        count += get_count(fact_c)


    
    
    
    
    
        
    
    
    
    
    
    
    
    
    
    
                    
    
    
    
    

    print(count)
main()

Solution (Python):
N = int(input())
L_P = []
num = N
ans = 0
if N == 1:
    print(ans)
else:
    for i in range(2,int(-(-num**0.5//1))+1):
        if num % i == 0:
            cnt = 0
            while num % i == 0:
                cnt += 1
                num //= i
            L_P.append(cnt)
        if num == 1:
            break
    else:
        L_P.append(1)
    for x in L_P:
        for i in range(1,100):
            if i*(i+1)//2 > x:
                ans += i-1
                break
    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 = int(input())

fact = factorization(a)

count = 0

for tup in fact:
    countTup = 0
    while True:
        countTup += 1
        if tup[1] < countTup:
            break
        tup[1] -= countTup
    count += countTup - 1

if a == 1:
    print(0)
else:
    print(count)

Solution (Python):
import math

def f(n):
    arr = list()
    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(tuple([i, cnt]))

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

    if len(arr) == 0:
        tup = tuple([n, 1])
        arr.append(tup)

    return arr

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

t = f(N)
res = 0

for a in t:
    cnt = 0
    c = 0
    while cnt <= a[1]:
        c += 1
        cnt += c
    res += c - 1
    
print(res)

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

if n == 1:
    c = 0
else:
    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])
    z = []
    for i in arr:
        for j in range(1,i[1]+1):
            z.append(i[0]**j)
    z = sorted(set(z))
    c = 0
    for i in z:
        if n%i == 0:
            c += 1
            n = int(n/i)
print(c)

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 countLoop(n):
  if n == 1 :
    return 1
  cnt = 0
  for i in range(1,n+1):
    if n >= i :
      n -= i
      cnt += 1
    else :
      return cnt

n = int(input())

c =  collections.Counter(prime_factorize(n))

cnt = 0
for x in c:
  cnt += countLoop(c[x])

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

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

for i in (c.keys()) :
    for j in range (50) :
        if j*(j+1)/2 <= c[i] < (j+1)*(j+2)/2 :
            ans += j

print(ans)

Solution (Python):
import collections
import numpy as np

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

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



d = np.floor((-1. + np.sqrt(1 + 8 * np.array(list(c.values()))))/2)

print(int(np.sum(d)))

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

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

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

    return arr

import math

n = int(input())

lis = factorization(n)

c = 0

for i in range(len(lis)):
    b = math.floor((lis[i][1]*2)**(1/2))
    if b*(b+1) > lis[i][1]*2:
        b = b - 1
    c = c + b
if n == 1:
    print(0)
else:
    print(c)

Solution (Python):
n=int(input())
a={}
temp=n
for i in range(2,int(n**0.5)+1):
    if temp % i ==0:
        count=0
        while temp % (i**(count+1)) ==0:
            count+=1
        temp= temp/(i**count)
        a[i]=count
if temp !=1:
    a[temp]=1

sum=0
for i in a:
  jisu= a[i]
  temp=1
  while temp*(temp+1)/2<= jisu:
          temp+=1
  sum+= temp-1
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

n = int(input())
ans = 1


arr = factorization(n)

cnt  = 1
ans = 0
flag = False
while True:
  for k in arr:
    if k[1] >= cnt:
      k[1] -= cnt
      ans += 1
      flag = True
  if not flag:
    break
  cnt += 1
  flag = False

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

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

ans = 0

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)

if a == []:
    print(0)
else:
    c = collections.Counter(a)
    for i in c.values():
        m = 1
        while 2*(i+1)>(m+1)*(m+2):
            m += 1
        ans += m
    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))

c = list(c.values())

ans = 0

for i in range(len(c)):
    j = 1
    num = c[i]
    while num >= j:
        ans += 1
        num -= j
        j += 1
print(ans)

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

def divisore(n):
    divisors=[]
    for i in range(1,int(n**0.5)+1):
        if n%i==0:
            divisors.append(i)
            if i!=n//i:
                divisors.append(n//i)
    divisors.sort()
    return divisors

def factorization(n):
    p=2
    fcr=[]
    while p*p<=n:
        while n%p==0:
            fcr.append(p)
            n//=p
        p+=1
    if n>1:
        fcr.append(n)
    return fcr

l=divisore(n)[1:]

ans=0
for i in l:
  t_l=factorization(i)
  if len(set(t_l))!=1:
    continue

  if n%i==0:
    ans+=1
    n//=i

print(ans)

Solution (Python):
import sys

n = int(sys.stdin.readline())

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

def 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 calc(n):
    used = set()
    a = 0
    c = True
    c1 = []
    ds = divisors(n)
    m = max(ds)
    for d in ds:
        if not isPrime(d):
            continue
        v = d
        i = 1
        while v <= m:
            c1.append(v)
            i += 1
            v = d ** i
    c1.sort()
    while c:
        c = False
        for d in c1:
            if d in used:
                continue
            if n % d != 0:
                continue
            
            n //= d
            a += 1
            c = True
            used.add(d)
            break
    return a

print(calc(n))

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


def counter(n):

    ccc = 1

    for i in range(2, 16):
        n -= i
        if n < 1:
            return ccc
        else:
            ccc += 1


results = prime_factorize(n)
numbers = {}

for nn in results:
    if nn in numbers.keys():
        numbers[nn] += 1
    else:
        numbers[nn] = 1

output = 0
for v in numbers.values():
    output += counter(v)

print(output)

Solution (Python):
n=int(input())
count=0
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 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
  
for i in make_divisors(n):
  if int(n)!=n or n==1:
    break
  if n%i==0 and len(factorization(i))==1:
    n=n/i
    count+=1
if count-1>=0:
  print(count-1)
else:
  print(0)

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 readinput():
    n=int(input())
    return n

def possibleCnt(n):
    cnt=0
    resu=n
    for i in range(1,n+1):
        if resu >= i:
            cnt+=1
            resu-=i
            
    return cnt       

def main(n):
    ansList=factorization(n)
    
    count=0
    for l in ansList:
        if(l[0]!=1):
            count+=possibleCnt(l[1])
    return count    


if __name__=='__main__':
    n=readinput()
    ans=main(n)
    print(ans)

Solution (Python):

n=int(input())

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

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

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

    return arr

arr2=[]
arr2=factorization(n)

def cnt(nn):
    if nn<3:
        return 1
    elif nn<6:
        return 2
    elif nn<10:
        return 3
    elif nn<15:
        return 4
    elif nn<21:
        return 5
    elif nn<28:
        return 6
    elif nn<36:
        return 7
    elif nn<45:
        return 8
    elif nn<55:
        return 9
    else:
        return 10
icnt=0
for i in range(len(arr2)):
    icnt=icnt+cnt(arr2[i][1])

if n==1:
    print(0)
else:
    print(icnt)

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 resolve():
    N = int(input())
    if N == 1:
        print(0)
    else:
        N_fact = factorization(N)
        ans = 0
        for i in range(len(N_fact)):
            Ni =  N_fact[i][1]
            ans = ans + int((-1 + math.sqrt(1 + 8 * Ni)) / 2)
        print(ans)
resolve()

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())
    if N == 1:
        print(0)
        return
    arr = factorization(N)
    CNT = 0
    for p, e in arr:
        CNT += 1
        for i in range(2, 100):
            if e > i:
                e -= i
                CNT += 1
            else:
                break
    print(CNT)

if __name__ == '__main__':
    main()

Solution (Python):
import sys


import math
import collections

import bisect
import itertools
import fractions

import copy
import heapq
import decimal

import queue

sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))





def main():
    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 = ni()
    a = prime_factorize(n)

    c = collections.Counter(a)

    ans = 0
    for v in c.values():
        cnt = 1
        while True:
            v -= cnt
            cnt += 1
            if v >= 0:
                ans += 1
            else:
                break

    print(ans)


if __name__ == '__main__':
    main()

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

a=int(input())
b=factorization(a)
ans=0
for i in range(len(b)):
    c=b[i][1]
    check=math.floor(((-1)+math.sqrt(1+8*c))/2)
    ans=ans+check
if a==1:
    print(0)
else:
    print(ans)

Solution (Python):
import collections

N = int(input())

A = list()
if N == 1:
	A.append(1)
else:
	while N%2 == 0:
		A.append(2)
		N = N//2
	f = 3
	while f*f <= N:
		if N % f == 0:
			A.append(f)
			N = N//f
		else:
			f += 2
	if N != 1:
		A.append(N)

A = collections.Counter(A)
del A[1]
count = 0

for a in A.values():
	n = 1
	th = n*(n+1)/2
	while a >= th:
		n += 1
		th = n*(n+1)/2
	count += n-1

print(count)

Solution (Python):
def resolve():
    '''
    code here
    '''
    import math
    import collections

    N = int(input())

    def mk_factor(num):
        max_divisor = int(math.sqrt(num))+1
        divisor = 2
        factor_list = [1]

        while divisor <= max_divisor:
            if num % divisor == 0:
                factor_list.append(divisor)
                num //= divisor
            else:
                divisor += 1

        factor_list.append(num)
        return factor_list


    fact_dic = dict(collections.Counter(mk_factor(N)))

    fact_dic.pop(1)

    cnt = 0
    for i in range(1, int(math.sqrt(N))+1):
        for j in fact_dic.keys():
            if fact_dic[j] >= i:
                cnt += 1
            fact_dic[j] -= i


    print(cnt)

if __name__ == "__main__":
    resolve()

Solution (Python):
from math import sqrt, ceil

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

ans = 0
search_list = make_divisors(N)[1:]
if (N > 1) and (N not in search_list):
    search_list.append(N)

for i in search_list:
    if N%i == 0:
        fact = factorization(i)
        if len(fact) == 1:
            N = N // i
            if N >= 1:
                ans += 1
            else:
                break

print(ans)

Solution (Python):
import math
from collections import defaultdict


N = int(input())
n = N

factor = defaultdict(lambda: 0)
tmp = int(math.sqrt(N))+1
for num in range(2,tmp):
    while N % num == 0:
        N //= num
        factor[num] += 1
if not factor and n!=1:
    factor[n] += 1
elif N != 1:
    factor[N] += 1



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

print(ans)

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines



def factorize(x):
      res = []
      for i in range(2, int(x**0.5)+1):
          if x%i != 0:
              continue
          cnt = 0
          while x%i == 0:
              x //= i
              cnt += 1 
          res.append((i, cnt))
      if x != 1:
          res.append((x, 1))
      return res
 
def main():
    n = int(readline())
    if n == 1:
        print(0)
        return
    fact = factorize(n)
    num = [int(i) for i in range(50)]
    def f(x):
        i = 2
        j = 2
        cnt = 1
        while 1:
            if x<=i:
                break
            cnt += 1
            j += 1
            i += j
        return cnt 
    ans = 0
    for i, j in fact:
        ans += f(j)
    print(ans)
if __name__ == '__main__':
    main()

Solution (Python):
import math

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[1:] + upper_divisors[::-1]

def isPrime(n):
  if n == 2:
    return True
  if n % 2 == 0:
    return False

  m = math.floor(math.sqrt(n)) + 1
  for p in range(3, m, 2):
      if n % p == 0:
        return False
  return True


n = int(input())
if n == 1:
    print(0)
    exit()
if isPrime(n):
    print(1)
    exit()
div = make_divisors(n)
ans = 0
for i in range(len(div)):
    if n % div[i] == 0:
        divdiv = make_divisors(div[i])
        if div[i] == divdiv[0] ** len(set(divdiv)):
            if isPrime(divdiv[0]):
                n //= div[i]
                ans += 1
    if n == 1:
        break
print(ans)