Problem:
 Score : 400 points    Problem Statement  Given is a positive integer N . Consider repeatedly applying the operation below on N :   First, choose a positive integer z satisfying all of the conditions below:  z can be represented as z=p^e , where p is a prime number and e is a positive integer;  z divides N ;  z is different from all integers chosen in previous operations.    Then, replace N with N/z .   Find the maximum number of times the operation can be applied.      Constraints   All values in input are integers.  1 \leq N \leq 10^{12}         Input  Input is given from Standard Input in the following format:  N       Output  Print the maximum number of times the operation can be applied.        Sample Input 1 24      Sample Output 1 3  We can apply the operation three times by, for example, making the following choices:   Choose z=2 (=2^1) . (Now we have N=12 .)  Choose z=3 (=3^1) . (Now we have N=4 .)  Choose z=4 (=2^2) . (Now we have N=1 .)        Sample Input 2 1      Sample Output 2 0  We cannot apply the operation at all.       Sample Input 3 64      Sample Output 3 3  We can apply the operation three times by, for example, making the following choices:   Choose z=2 (=2^1) . (Now we have N=32 .)  Choose z=4 (=2^2) . (Now we have N=8 .)  Choose z=8 (=2^3) . (Now we have N=1 .)        Sample Input 4 1000000007      Sample Output 4 1  We can apply the operation once by, for example, making the following choice:   z=1000000007 (=1000000007^1) . (Now we have N=1 .)        Sample Input 5 997764507000      Sample Output 5 7

Solution (Python):

import sys
import math


def II(): return int(sys.stdin.readline())


def MI(): return map(int, sys.stdin.readline().split())


def LI(): return list(map(int, sys.stdin.readline().split()))


def generatePrimes(n):
    if n < 2:
        return []
    isPrimeArray = [True] * (n + 1)
    isPrimeArray[0], isPrimeArray[1] = False, False
    for i in range(2, n+1):
        if isPrimeArray[i]:
            k = 2 * i
            while k < n + 1:
                isPrimeArray[k] = False
                k += i
    return list(filter(lambda i: isPrimeArray[i], range(n+1)))


def main():
    N = II()
    if N <= 1:
        print(0)
        exit()
    max_prime = math.ceil(N**0.5)
    primes = generatePrimes(max_prime)
    es = [0] * len(primes)
    for i in range(len(primes)):
        while N % primes[i] == 0:
            N /= primes[i]
            es[i] += 1

    ans = 0
    if int(N) != 1:
        ans += 1

    for i in range(len(es)):
        k = 1
        while es[i] - k >= 0:
            es[i] -= k
            k += 1
            ans += 1

    print(ans)


main()

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==[] and n!=1:
        arr.append([n, 1])

    return arr

arr = factorization(N)


candidate_arr = sorted([arr[i][0]**(j+1) for i in range(len(arr)) for j in range(arr[i][1])])

ans = 0
for c in candidate_arr:
    if N%c==0:
        ans+=1
        N /= c

print(ans)

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

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

factor = prime_factor(n)

cnt = 0
for p in factor:
    if n % p == 0:
        e = 1
        while n % pow(p, e) == 0:
            cnt += 1
            n //= pow(p, e)
            e += 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())
if N == 1:
  print(0)
  exit()
a = factorization(N)
cnt = 0
for i in a:
  temp = i[1]-1
  d = 2
  while temp>=d:
    temp -= d
    d += 1
  cnt+=d-1
print(cnt)

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

N = int(input())
if N == 1:
    count = 0
else:
    fact = factorization(N)
    count = 0

    for i in range(len(fact)):
        count += math.floor((-1+(1+8*fact[i][1])**0.5)/2)
print(count)

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
if n == 1:
    print(0)
    exit()
primes = prime_factorize(n)
max_primes = primes[-1]
dic = {}
tmp = 0
for i in primes:
    if i not in dic:
        dic[i] = 1
        tmp = 0
        continue
    if tmp == 0:
        tmp = i
    else:
        tmp *= i
        if tmp not in dic:
            dic[tmp] = 1
            tmp = 0
print(len(dic))

Solution (Python):
from collections import Counter

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

n = int(input())
prime_numbers = prime_factorize(n)
prime_counter = Counter(prime_numbers)

ans = 0
for v in prime_counter.values():
    i = 1
    while v >= i:
        ans += 1
        v -= i
        i += 1

print(ans)

Solution (Python):
from math import sqrt

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

ans =0
for value in pf.values():
    ans += int((sqrt(value*8+1)-1)/2)
print(ans)

Solution (Python):

import sys
n = int(input())

def factorization(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 arr == []: 
        arr.append([n, 1])
    return arr

p = factorization(n)
count = 0

for x in p:
    
    if n == 1:
        break
    
    for j in range(1, x[1] + 1):
        if n % (x[0]**j) == 0:
            n /= x[0]**j
            count += 1
        else:
            break
print(count)

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

def factorization(n):
    arr = []
    if n == 1:
        return 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_list = factorization(n)
ans = 0

for i in range(len(f_list)):
    _tmp = f_list[i][1]
    
    j = 1
    
    while _tmp >= 0:
        _tmp -= j
        j += 1
    ans += j-2

print(ans)

Solution (Python):
import sys 
import numpy as np   
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


readline = sys.stdin.readline 

N = int(input())

fact = prime_factorize(N)
collections_fact = collections.Counter(fact)

pre_z = 0
duplicate_num = 1
counter = 0
for z in fact:
    if z != pre_z:
        N /= z
        counter += 1
        duplicate_num = 1
    else:
        duplicate_num += 1
        duplicate_z = z**duplicate_num 
        if N % duplicate_z == 0:
            N /= duplicate_z
            counter += 1
    pre_z = z 

print(counter)

Solution (Python):
N = int(input())
A = [0 for k in range(int(N**0.5)+1)]


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


prime = [2]
for k in range(3, len(A), 2):
  if A[k] == 0:
    prime.append(k)
    for j in range(k, len(A), k):
      A[j] = 1
for p in prime:
  if N%p == 0:
    break
else: 
  print(1)
  exit()

use = []
for p in prime:
  if p > N:
    break
  if N%p == 0:
    ans += 1
    use.append(p)
    N = N // p
  np = p * p
  while N % np == 0:
    ans += 1
    N = N // np
    np = np * p
    
for u in use:
  while N % u == 0:
    N = N // u
if N > 1:
  ans += 1
print(ans)

Solution (Python):
N = int(input())
A = [0 for k in range(int(N**0.5)+1)]


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


prime = [2]
for k in range(3, len(A), 2):
  if A[k] == 0:
    prime.append(k)
    for j in range(k, len(A), k):
      A[j] = 1
for p in prime:
  if N%p == 0:
    break
else: 
  print(1)
  exit()

use = []
for p in prime:
  if p > N:
    break
  if N%p == 0:
    ans += 1
    use.append(p)
    N = N // p
  np = p * p
  while N % np == 0:
    ans += 1
    N = N // np
    np = np * p
    
for u in use:
  while N % u == 0:
    N = N // u
if N > 1:
  ans += 1
print(ans)

Solution (Python):
N = int(input())
A = [0 for k in range(int(N**0.5)+1)]


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


prime = [2]
for k in range(3, len(A), 2):
  if A[k] == 0:
    prime.append(k)
    for j in range(k, len(A), k):
      A[j] = 1
for p in prime:
  if N%p == 0:
    break
else: 
  print(1)
  exit()

used = []
use = []

for p in prime:
  if p > N:
    break
  if N%p == 0:
    
    ans += 1
    used.append(p)
    use.append(p)
    N = N // p
  np = p * p
  while N % np == 0:
    
    ans += 1
    used.append(np)
    N = N // np
    np = np * p
    



for u in used:
  if N % u == 0:
    N = N // u
for u in used:
  if N % u == 0:
    N = N // u
for u in used:
  if N % u == 0:
    N = N // u
if N > 1:
  ans += 1
print(ans)

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

ans = 0

d = 2
while d * d <= N:
  e = 0
  while N % d == 0:
    e += 1
    N //= d
  i = 1
  while i <= e:
    ans += 1
    e -= i
    i += 1
  d += 1

if N > 1:
  ans += 1
print(ans)

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

n = int(input())

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

p = factorization(n)

ans = 0
for i in p :
  c = i[1]
  ans += bisect.bisect_right(jd, c)
  
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 not arr:
        arr.append([n, 1])

    return arr


N = int(input())
p = factorization(N)
count = 0
for x in p:
    if N == 1:
        break
    for j in range(1, x[1] + 1):
        if N % (x[0] ** j) == 0:
            N /= x[0] ** j
            count += 1
        else:
            break
print(count)

Solution (Python):
import collections
N = int(input())
def pf(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(pf(N))
ans = 0
for i in c.keys():
    for j in range(1,40):
        if j*(j+1)/2 <= c[i] < (j+1)*(j+2)/2:
            ans += j
print(ans)

Solution (Python):
n=int(input())
a=[]
while(n%2==0):
    a.append(2)
    n=n/2
for i in range(3,int((n**0.5))+1,2):
    while(n%i==0):
        a.append(i)
        n=n/i
if(n>2):
    a.append(int(n))
l=list(set(a))
c=1
t=0
for i in range(len(l)):
    while(0.5*(c*(c+1))<=a.count(l[i])):
        t=t+1
        c=c+1
    c=1
print(t)

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

ans = 0

n = int(input())
for i,j in factorization(n):
  if i == 1:
    continue
  for k in range(int((2 * j)**0.5), 0 ,-1):
    if k*(k+1) <= 2 * j and (k+1)*(k+2) >= 2 * j:
      ans += k
      break
print(ans)

Solution (Python):
import math
 
N = int(input())
Prime = []
ans = 0
 
def func(n):
    while n % 2 == 0:
        n = n // 2
        Prime.append(2)
    for i in range(3, int(math.sqrt(n)) + 1, 2):
        while n % i == 0:
            n = n //i
            Prime.append(i)
    if n > 2:
        Prime.append(n)
 
func(N)
 
for i in set(Prime):
    c = i
    while N % c == 0:
        N = N // c
        ans += 1
        c = c * i
 
print(ans)

Solution (Python):
N = int(input())
NN = N
L = []
p = 2
while p <= int(N**0.5):
    if N % p == 0:
        L.append([p])
        N /= p
        while N % p == 0:
            L[-1].append(p)
            N /= p
    p += 1
if N != 1:
    L.append([int(N)])
ans = 0
for i in range(len(L)):
    for j in range(1,len(L[i])+1):
        if NN % (L[i][0])**j == 0:
            NN = NN // (L[i][0])**j
            ans += 1
        else:
            break
print(ans)

Solution (Python):
from itertools import groupby
n =int(input())

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

from itertools import groupby
ans = 0
p = prime_decomposition(n)
for k,g in groupby(p):
  gn = len(list(g))
  for i in range(1,1000000):
    gn -= i
    if gn >= 0:
      ans += 1
    else:
      break
print(ans)

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

from itertools import groupby
N = int(input())
P = prime_decomposition(N)
ans = 0
for v, g in groupby(P):
    n = len(list(g))
    for i in range(1, 100000):
        n -= i
        if n >= 0:
            ans += 1
        else:
            break
print(ans)

Solution (Python):
def prime(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(""))
s=0
if(n!=1):
    

    

    t=0
    lista=prime(n)
    
    
    c=lista[0]
    for i in lista:
        if (c==i):
            t+=1
        else:
            k=1
            while(t>=k):
                t-=k
                s+=1
                k+=1
            t=1
            c=i


    k=1
    while(t>=k):
        t-=k
        s+=1
        k+=1
        


            
        
        
    
    


print(s)

Solution (Python):
import sys
import collections



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 main():
    input = sys.stdin.readline
    change_to_count_list = []
    for i in range(62):
        if i == 0:
            change_to_count_list.append(1)
        else:
            change_to_count_list.append(change_to_count_list[i-1]+i+1)
    N = int(input())
    yakusu_list = factorize(N)
    c = collections.Counter(yakusu_list)
    result = 0
    for count in c.values():
        for i in range(62):
            if change_to_count_list[i] == count:
                if i == 0:
                    result += 1
                    break
                else:
                    result += i + 1
                    break

            elif change_to_count_list[i-1] < count and change_to_count_list[i] > count:
                result += i
                break
    print(result)


if __name__ == '__main__':
    main()

Solution (Python):
def f(n):
    res = 0
    s = 0
    for i in range(1,n+1):
        s += i
        if s <=n:
            res = i
        else:
            break
    return res
n = int(input())
p =2
ans = 0
while p*p <= n:
    e = 0
    while n%p == 0:
        e += 1
        n//=p
    ans += f(e)
    p +=1
if n >1:
    ans += 1
print(ans)

Solution (Python):
def this (k):
  a=int(pow(1+8*k,0.5))
  return (a-1)//2
from collections import Counter
c=Counter([])
n=int(input())
for i in range(2,int(pow(n,0.5))+1):
  if n%i==0:
    sumi=0
    while n%i==0:
      n=n//i
      sumi+=1
    c[i]=sumi
if n!=1:
  c[n]=1
ans=0
for item in c.values():
  ans+=this(item)
print (ans)

Solution (Python):
def prime(n):
    nums = [True]*n
    primes = []
    for i in range(2,n):
        if nums[i]:
            primes.append(i)
            for j in range(2*i,n,i):
                nums[j] = False
    return primes

def prime_fac(n):
    fac = {}
    primes = prime(int(n**0.5)+1)
    for p in primes:
        while n%p==0:
            fac[p] = fac.get(p,0)+1
            n//=p
    if n > 1:
        fac[n] = 1
    return fac

def main():
    n = int(input())
    fac = prime_fac(n)

    ans = 0
    for i in fac.values():
        ct = 1
        while i >= ct*(ct+1)//2:
            ct += 1
            ans+=1
    print(ans)
main()

Solution (Python):
import math
from collections import Counter

N = int(input())

max_itr = math.ceil(math.sqrt(N))

factors = []
while True:
    for i in range(2, max_itr):
        if N%i == 0:
            N = N // i
            factors.append(i)
            break
    else:
        if N != 1:
            factors.append(N)
        break

c = Counter(factors)
f = lambda x: math.floor((math.sqrt(8*x+1) - 1)/2)
print(sum(f(v) for v in c.values()))

Solution (Python):
import math
a=int(input())
ans=0
for i in range(1,int(math.sqrt(a)),1):
  if a%i==0 and not i==1:
    cnt=0
    while a%i==0:
      cnt+=1
      a=a/i
    ans+=(math.sqrt(2*cnt+0.25)-0.5)//1
if not a==1:
  print(int(ans+1))
else:
  print(int(ans))

Solution (Python):
from collections import Counter

def get_prime_factors(x):
    out = []
    if x < 1:
        return out
    while not x%2:
        out.append(2)
        x //= 2
    i = 3
    while i*i <= x:
        if not x%i:
            out.append(i)
            x //= i
        else:
            i += 2
    if x != 1:
        out.append(x)
    return out
    
def main():
    n = int(input())
    primes = Counter(get_prime_factors(n))
    ans = 0
    for k, v in primes.items():
        num = 1
        while v >= num:
            v -= num
            ans += 1
            num += 1
    print(ans)
    

if __name__ == "__main__":
    main()

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 != 0 and temp != 1:
        arr.append([temp, 1])

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

    return arr

arr = factorization(N)
ans = 0
for i in range(len(arr)):
    for j in range(arr[i][1]):
        if j / 2 * (j + 3) + 1 <= arr[i][1] < (j + 1) / 2 * (j + 4) + 1:
            ans += j + 1
            break

print(ans)

Solution (Python):
from collections import Counter

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


n = int(input())

A = list(Counter(prime_factorization(n)).values())

ans = 0
e = 1
while True:
    cnt = 0
    for i in range(len(A)):
        if A[i] >= e:
            A[i] -= e
            cnt += 1
    if cnt == 0:
        break
    ans += cnt
    e += 1

print(ans)

Solution (Python):
from collections import Counter
n = int(input())
ans = 0

dp = []
cl = []
n1 = n
if n == 1:
    ans = 0
else:
    for i in range(2, int(n**0.5)+1):
        if n%i == 0:
            cl.append(i)
            while n%i == 0:
                n = n/i
                dp.append(i)
        if n == 1:
            break
    if n != 1:
        ans = 1

c = Counter(dp)

for i in cl:
    cnt = 1
    while c[i] >= cnt:
        c[i] -= cnt
        ans += 1
        cnt += 1
        
print(ans)

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

while n%2==0:
  n//=2
  d[2]+=1
f=3

while f*f<=n:
  if n%f==0:
    n//=f
    d[f]+=1
  else:
    f+=2
if n!=1:
  d[n]+=1
c=0
for k,v in d.items():
  i=1
  while v>=i:
    v-=i
    c+=1
    i+=1
print(c)

Solution (Python):
import math

n = int(input())

prm_dict = {}
for i in range(2, math.floor(math.sqrt(n))):
    while n % i == 0:
        n //= i
        if i not in prm_dict.keys():
            prm_dict[i] = 0
        prm_dict[i] += 1
    if n == 1:
        break
if n != 1:
    prm_dict[n] = 1

ans = 0
for prm in prm_dict.keys():
    prm_cnt = prm_dict[prm]
    i = 1
    while prm_cnt >= i:
        prm_cnt -= i
        i += 1
        ans += 1

print(ans)

Solution (Python):
import math
Max = 1000001
prime = Max*[1]
def sieve():
	prime[0] = 0
	prime[1] = 0
	for i in range(2,Max):
		if prime[i]==1:				
			j = 2*i
			while j < Max:
				prime[j] = 0
				j += i

def Howmany(x):
	res = 1
	while x>=res:
		x -= res
		res += 1
	return res-1

N = int(input())
sieve()
ans = 0
R = int(math.sqrt(N))
for i in range(2, R):
	if prime[i]==1 and N%i==0:
		cnt = 0
		while N%i==0:
			N //= i
			cnt+=1
		ans += Howmany(cnt)

if N!=1:
	ans += 1
print(ans)

Solution (Python):
import numpy as np
import math
from decimal import *


def getVar():
    return map(int, input().split())
def getArray():
    return list(map(int, input().split()))
def getNumpy():
    return np.array(list(map(int, input().split())), dtype='int64')

def factorization(n):
    d = {}
    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
            d.update({i: cnt})

    if temp!=1:
        d.update({temp: 1})

    if d==[]:
        d.update({n:1})

    return d

def main():
    N = int(input())
    d = factorization(N)
    count = 0

    for v in d.values():
        i = 1
        while(v >= i):
            v -= i
            i += 1
            count += 1
        
    print(count)


main()

Solution (Python):

import math
N = int(input())

n = N
i = 2
f = {} 
while i * i <= n:
  count = 0
  while n % i == 0:
    count += 1
    f[i] = count
    n /= i
  i += 1
if 1 < n:
  f[n] = 1

if len(f) == 0:
  print(0)
  exit()

count = 0
for v in f.values():
  d = 1
  while v > 0:
    v -= d
    if v >= 0:
      count += 1
    d += 1
print(count)

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 countstep(a):
    i = 0
    while a>=i+1:
        i += 1
        a -= i
    return i

def main():
    n = int(input())
    a = factorization(n)
    
    if n==1:
        print(0)
        return
    
    if a[0][0]==0:
        print(0)
    else:
        count = 0
        for i in range(len(a)):
            count += countstep(a[i][1])
        print(count)

if __name__ == "__main__":
    main()

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

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

    return a

s=dict(Counter(prime_factorize(n)))

sum_ans=0
for i in s.values():
  
  if i==1:
    sum_ans+=1
    
  else:
    k=1
    while i>0:
      i-=k
      k+=1
      
      if i<0:
        break
      sum_ans+=1
      
print(sum_ans)

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

def factrization(m):
    temp = m
    ans = 0
    for i in range(2, int(n**0.5) + 1):
        if temp % i == 0:
            cnt = 0
            e = 1
            while temp % i == 0:
                cnt += 1
                temp //= i
                if cnt == e:
                    e += 1
                    cnt = 0
                    ans += 1

    if temp != 1:
        ans += 1

    return ans

print(factrization(n))

Solution (Python):




n = int(input())


def div_primes(x):
    ret = {}
    for i in range(2, int(x**0.5) + 1):
        tmp = 0
        while x % i == 0:
            tmp += 1
            x /= i
        if tmp > 0:
            ret[i] = tmp

    if x > 1:
        ret[x] = 1
    return ret


primes = div_primes(n)
ans = 0
for k, v in primes.items():
    j = 1
    while v - j >= 0:
        v -= j
        j += 1
        ans += 1
print(ans)

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

def prime(n: int) -> defaultdict:
    f, i = defaultdict(int), 2
    while i * i <= n:
        while n % i == 0: f[i] += 1; n //= i
        i += 1
    if n != 1: f[n] = 1
    return f

def solve(n: int) -> int:
    if n == 1: return 1
    r, l = n, 0
    while (r - l) > 1:
        m = (l + r) // 2
        if m * (m + 1) // 2 <= n: l = m
        else: r = m
    return l

n, res = int(input()), 0
for k, v in prime(n).items(): res += solve(v)
print(res)

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

i=2
l=0
k=int(math.sqrt(n))+1
s=[0]*k
while i<k:
    if s[i]==0:
        z=i
        while n%z==0:
            n//=z
            
            z*=i
            l+=1
        while n%i==0:
            n//=i
            
            
    for j in range(i,k,i):
        s[j]=1
    i+=1
if n>1:
    r=0
    for i in range(2,k):
        if n%i==0:
            r=1
            break
    if r==0:
        l+=1
print(l)

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

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

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

    return arr

N = int(input())
if N == 1:
    print(0)
    sys.exit()
a = factorization(N)
ans = 0

for i in range(len(a)):
    k = a[i][1]
    cnt = 1
    while k-cnt>=0:
        k -= cnt
        cnt += 1
    ans += cnt-1
    
    
print(ans)

Solution (Python):



from collections import Counter

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
  
n = int(input())
x = Counter(prime_factorize(n))
x_keys = list(x.keys())
x_values = list(x.values())
ans = 0
for i in range(len(x_keys)):
    z = x_values[i]
    mai = 1
    while z - mai >= 0:
        z -= mai
        mai += 1
        ans += 1
print(ans)

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

d = 2
ans = 0

while d * d <= n:
    if n % d != 0:
        d += 1
        continue

    z = d
    while n % z == 0:
        n //= z
        z *= d
        ans += 1

    while n % d == 0:
        n //= d

if n != 1:
    ans += 1

print(ans)

Solution (Python):
import collections


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

N = int(input())
res = collections.Counter(prime_factorize(N)) 
keys = list(res.keys()) 
length = len(keys)
ans = 0


for i in range(length):
    num = keys[i] 
    beki = res[num] 
    temp = 1
    while(beki >= temp):
        beki -= temp
        ans += 1
        temp += 1
print(ans)

Solution (Python):
import math

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

def pf(n):
    sn = int(math.sqrt(n)) + 1
    ps = []
    for i in range(1, sn):
        if (n%i)==0:
            ps.append(i)
            ps.append(int(n/i))
    del ps[0]
    return ps        

n = int(input())
ps = []
num = pf(n)
for i in num:
    if is_prime(i):
        ps.append(i)
        
zs = []        
for p in ps:
    z = p
    while(z<=n):
        zs.append(z)
        z *= p
zs.sort()

cnt = 0
for z in zs:
    if(n>1):
        if(n%z==0):
            n /= z
            cnt += 1
print(cnt)

Solution (Python):
n = int(input())
ans = 0
flag = True if n == 1 else False

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

idx = 3
while n > idx**2:
    tmp = 0
    if n % idx == 0:
        while n % idx == 0:
            n //= idx
            tmp += 1
        i = 1
        while tmp >= (i+1)*(i+2)//2:
            i += 1
        ans += i
    idx += 2

print(0 if flag else (ans+1 if n > 1 else ans))

Solution (Python):
def resolve():
    import sys
    import collections
    sys.setrecursionlimit(10 ** 6)  
    to_index = lambda x: int(x) - 1  
    print_list_in_2D = lambda x: print(*x, sep="\n")  

    
    def input_int():
        return int(input())

    def map_int_input():
        return map(int, input())

    MII = map_int_input

    def MII_split():
        return map(int, input().split())

    def MII_to_index():
        return map(to_index, input())

    def MII_split_to_index():
        return map(to_index, input().split())

    
    def list_int_inputs():
        return list(map(int, input()))

    LII = list_int_inputs

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

    
    def LII_2D(rows_number):
        return [LII() for _ in range(rows_number)]

    def LII_split_2D(rows_number):
        return [LII_split() for _ in range(rows_number)]

    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 = input_int()
    c = collections.Counter(prime_factorize(N))
    ans = 0
    
    for _, value in c.items():
        for i in range(41):
            if value > i:
                value -= i + 1
                ans += 1
            else:
                break
    print(ans)
    
resolve()