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())
prime_list = []

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

for i in range(2, int(math.sqrt(n)) + 1):
    if n % i == 0:
        prime_list.append(i)
        n /= i
        index = 2
        counter = 0
        while 1:
            if n % i == 0:
                counter += 1
                n /= i
                if(counter == index):
                    prime_list.append(i ** index)
                    index += 1
                    counter = 0
            else:
                break
if n > 1:
    prime_list.append(n)

print(len(prime_list))

Solution (Python):
def d_div_game():
    def prime_factorization_dict(n):
        """n を素因数分解したときの素数とその指数の辞書"""
        from collections import defaultdict
        if n == 1:
            return {2: 0}  
        i, table = 2, defaultdict(int)
        while i**2 <= n:
            while n % i == 0:
                table[i] += 1
                n //= i
            i += 1
        if n > 1:
            table[n] = 1
        return table

    def sub_calc(n):
        """t = 1 + ... + e <= n となる最大の e を求め、そのときの項数を返す"""
        t, e = 0, 1
        while True:
            t += e
            if t > n:
                return e - 1
            e += 1

    return sum(sub_calc(v) for v in prime_factorization_dict(int(input())).values())

print(d_div_game())

Solution (Python):
from math import floor, sqrt


def func(x):
    return floor((sqrt(1 + 8 * x) - 1) / 2)


N = int(input())
limit = floor(sqrt(N))

primes = [2]

count = 0
flag = True
p = 2
while 1:
    
    isprime = True
    if N == 1:
        break
    if p > sqrt(N):
        count += 1
        break
    
    a = 0
    while N % p == 0:
        
        a += 1
        N = N // p
    count += func(a)
    if p == 2:
        p = 3
    else:
        p += 2
print(count)

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



def prime_factorization(n):
    
    fact_list = []
    for p in range(2, int(math.sqrt(n)) + 1):
        e = 0
        while n % p == 0:
            n //= p
            e += 1
        if e > 0:
            fact_list.append((p, e))
    if n != 1:
        fact_list.append((n, 1))
    return fact_list


prime_list = prime_factorization(N)
if len(prime_list) == 0:
    print(0)
else:
    count = 0
    for p, e in prime_list:
        a = 1
        sum_a = 0
        while True:
            sum_a += a
            if e < sum_a:
                break
            a += 1
        count += a - 1
    print(count)

Solution (Python):
def gen_prime_decompositon(n):
    x = n
    d = 2
    cnt = 0
    while x % d == 0:
        x //= d
        cnt += 1
    if cnt != 0: yield cnt

    d = 3
    while d * d <= n:
        cnt = 0
        while x % d == 0:
            x //= d
            cnt += 1
        if cnt != 0: yield cnt
        d += 2

    if x > 1:
        yield 1


def main():
    from bisect import bisect_left
    from itertools import accumulate

    N = int(input())

    *acc, = accumulate(range(1, 40 + 1))

    ans = 0
    for cnt in gen_prime_decompositon(N):
        ans += bisect_left(acc, cnt + 1)  

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
def prime_f(n,p=2):
    if n==1:
        return []
    while True:
        if n<p**2:
            return [n]
        if n%p==0:
            l=prime_f(n//p,p)
            l.append(p)
            return l
        p+=1


def histo_list(lis):
    if lis==[]:
        return []
    new=[[lis[0],1]]
    d=lis[0]
    for c in range(1,len(lis)):
        if lis[c]!=d:
            new.append([lis[c],1])
            d=lis[c]
        else:
            new[-1][1]+=1
    return new


n=int(input())
a=prime_f(n)
a=a[::-1]
b=histo_list(a)
c=[b[x][1] for x in range(len(b))]
s=0
for x in c:
    s+=((8*x+1)**0.5-1)//2
print(int(s))

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




ans = 0
for v in c.values():
    t = 1
    while v >= t:
        v -= t
        t += 1
        ans += 1
print(ans)

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())
pl = factorization(n)
if len(pl) == 0: exit(print(0))
count = 0
for a,b in pl:
    if a==1 and b==1: exit(print(0))
    t=1
    while True:
        if b < t: break
        count += 1
        b-=t
        t+=1
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

fact_N = factorization(N)



num_sosuu = []
for row in fact_N:
    num_sosuu.append(row[1])




ans = 0
for i in range(len(num_sosuu)):
    num_i = num_sosuu[i]


    j = 0
    judge = True
    while judge:
        if num_i >= j+1:
            ans += 1
            num_i -= j+1
            j+=1
        else:

            judge = False

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

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




























































































def 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

fs = factorize(N)

from collections import Counter
c = Counter(fs)

ans = 0
i = 1
for k, v in c.items():
    k2, v2 = k,v
    while v2 >= i:
        ans += 1
        v2 -= i
        i += 1
    i = 1

print(ans)

Solution (Python):

import sys


def solve(N: int):
    
    
    
    

    def f(x):
        cnt = 0
        for i in range(1, x + 1):
            x -= i
            if x < 0:
                break
            cnt += 1
        return cnt

    print(sum([f(p[1]) for p in factorize(N)]))
    return


def factorize(n: int):
    """nの素因数分解を求める"""
    res = []
    for i in range(2, int(n ** 0.5//1 + 2)):
        if n % i:
            continue
        s = 0
        while n % i == 0:
            n /= i
            s += 1
        res.append([i, s])
    if n != 1:
        res.append([n, 1])
    return res



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):
import itertools
import math
import fractions
import functools
import copy
from collections import deque
from functools import reduce
from decimal import Decimal

n = int(input())

def how_many_prime(n):
    prime = {}
    num = n
    i = 2
    while True:
        if i * i > n:
            if(num > 1):
                prime[num] = 1
            break
        while num % i == 0:
            prime[i] = prime.get(i, 0) + 1
            num = num//i
        i += 1
    return prime

prime = how_many_prime(n)

count = 0
for val in prime.values():
    use = 1
    while True:
        if(val < use):
            break
        val -= use
        use += 1
        count += 1
print(count)

Solution (Python):
def factorisation(n):
  res = dict()
  i = 1
  while i * i <= n:
    i += 1
    if n % i != 0:
      continue
    res[i] = 0
    while n % i == 0:
      n //= i
      res[i] += 1
  if n > 1:
    res[n] = 1
  return res

n = int(input())
ind = factorisation(n)
ans = 0
for p in ind.keys():
  a = 1
  while ind[p] >= a:
    ind[p] -= a
    ans += 1
    a += 1
print(ans)

Solution (Python):
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

number=int(input())
consequence=factorize(number)
c=list(set(consequence))

ans=0

for i in range(len(c)):
    Count=consequence.count(c[i])
    d=f=1
    while Count >= d:
        f +=1
        d +=f
        ans +=1

print(ans)

Solution (Python):
class Sieve: 
    
    def __init__(self, n=1):
        self.f = [0 for _ in range(n+1)]
        self.f[0] = -1
        self.f[1] = -1
        self.primes = []
        for i in range(2, n+1):
            if self.f[i]:
                continue
            self.primes.append(i)
            self.f[i] = i
            for j in range(i*i, n+1, i):
                if not self.f[j]:
                    self.f[j] = i
    
    def isPrime(self, x):
        return self.f[x] == x
    
    def factorList(self, x):
        res = []
        while x != 1:
            res.append(self.f[x])
            x //= self.f[x]
        return res
    
    def factor(self, x):
        fl = self.factorList(x)
        if not len(fl):
            return []
        res = [[fl[0], 0]]
        for p in fl:
            if res[-1][0] == p:
                res[-1][1] += 1
            else:
                res.append([p, 1])
        return res



n = int(input())

s = Sieve(10**6+10)

prime_list = []
for i in range(2, 10**6+10):
    if s.isPrime(i):
        prime_list.append(i)

e = 1
pos = 0
ans = 0
while pos < len(prime_list) and n >= prime_list[pos]:
    p = prime_list[pos]
    if n%(p**e) == 0:
        ans += 1
        n //= p**e
        e += 1
    else:
        while n%p == 0:
            n //= p
        pos += 1
        e = 1

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

Solution (Python):
import math

N = int(input())

def judge(n):
    if n <= 1:
        return False
    for i in range(2, int(math.sqrt(n))+1):
        if n % i == 0:
            n //= i
            while n != 1:
                if n % i != 0:
                    return False
                n //= i
            return True
    return True
ans = 0
i = 2
limit = int(math.sqrt(N))
while N != 1:
    
    if i > limit:
        if N > i:
            ans += 1
        break
    if N % i == 0 and judge(i): 
        N //= i
        ans += 1
        
    i += 1
    
print(ans)

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




count = 0

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

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

if len(list(c.keys()))==1:
    for j in range(1, C[0][1]+1):
        if N%(C[0][0]**j) == 0:
            count += 1
            N /= C[0][0]**j

else:
    for i in range(len(C)):
        for j in range(1, C[i][1]+1):
            if N%(C[i][0]**j) == 0:
                count += 1
                N /= (C[i][0]**j)

print(count)

Solution (Python):
n=int(input())
ans=0
i=0
if n%2==0:
  while n%2==0:
    i+=1
    n//=2
def judge(n):
  s=0
  i=0
  while s<=n:
    i+=1
    s=i*(i+1)//2
  return i-1
ans+=judge(i)
for i in range(3,int(n**0.5),2):
  if n%i==0:
    cnt=0
    while n%i==0:
      n//=i
      cnt+=1
    ans+=judge(cnt)
if n!=1:
  ans+=1
print(ans)

Solution (Python):
import math

N = int(input())

def judge(n):
    if n <= 1:
        return False
    for i in range(2, int(math.sqrt(n))+1):
        if n % i == 0:
            n //= i
            while n != 1:
                if n % i != 0:
                    return False
                n //= i
            return True
    return True


def get_prime(n):
    if n <= 1:
        return []
    prime = [2]
    limit = int(math.sqrt(n))

    data = [i + 1 for i in range(2, n, 2)]
    while limit > data[0]:
        prime.append(data[0])
        data = [j for j in data if j % data[0] != 0]
    return prime + data

ans = 0
i = 2
limit = int(math.sqrt(N))
while N != 1:
    
    if i > limit:
        if N > i:
            ans += 1
        break
    if N % i == 0 and judge(i): 
        N //= i
        ans += 1
        
    i += 1
    
print(ans)

Solution (Python):



def parse(n):
    
    m = 1
    while m * (m + 1) <= 2 * n:
        m += 1
    return m - 1


def factorint(n):
    fct = []
    b, e = 2, 0
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def main():
    N = int(input())
    factors = factorint(N)
    print(sum(parse(v) for _, v in factors))
    return


if __name__ == "__main__":
    main()

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


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


A = prime_factorize(n)
C = collections.Counter(A)


count = 0

for v in C.values():
    i = 1
    while v >= i*(i+1)/2:
        i += 1
    count += i-1
print(count)

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 6)

def int1(x): return int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def SI(): return input().split()

def printlist(lst, k='\n'): print(k.join(list(map(str, lst))))
INF = float('inf')

from math import ceil, floor, log2
from collections import deque
from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product
from heapq import heapify, heappop, heappush

def prime_factorization(n):
    res = []
    for i in range(2, int(pow(n, 0.5))+1):
        if n % i: continue
        ex = 0
        while n % i == 0:
            n = n // i
            ex += 1
        res.append((i, ex))
    if n != 1:
        res.append((n, 1))
    return res

def solve():
    n = II()

    f = prime_factorization(n)
    

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

    ans = 0
    for (num, ex) in f:
        a = 1
        while ex > 0:
            ex -= a
            if ex >= 0:
                ans += 1
            a += 1
    print(ans)

if __name__ == '__main__':
    solve()

Solution (Python):
import math
from collections import Counter

N = int(input())

def getPrimeFactors(x):
    anss = []
    while x%2 == 0:
        anss.append(2)
        x //= 2
    for d in range(3, int(x**0.5)+1, 2):
        while x%d == 0:
            anss.append(d)
            x //= d
    if x != 1:
        anss.append(x)
    return anss

PFs = getPrimeFactors(N)
cnt = Counter(PFs)

ans = 0
for _, e in cnt.items():
    base = e * 2
    root = math.floor(math.sqrt(base))
    if root * (root + 1) > base:
        root -= 1
    ans += root
print(ans)

Solution (Python):
n = int(input())
a = []
b = n
d = 0
for i in range(2, int(n**0.5)+2):
    if b%i == 0:
        c = 0
        while b%i == 0:
            c += 1
            b //= i
        a.append(c)
if b != 1:
    a.append(1)
for i in range(len(a)):
    for j in range(1, 100):
        if a[i] >= j:
            d += 1
            a[i] -= j
        else:
            break;
print(d)

Solution (Python):
import math
from sys import exit

n=int(input())
primes = {}
i = 2
ans = 0
square = math.floor(math.sqrt(n))

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

primes = factorization(n)

for k,v in primes:
    base = v * 2
    root = math.floor(math.sqrt(base))
    if root * (root + 1) > base:
        root -= 1
    ans += root

print(ans)

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

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

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

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

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

    return arr

st = factorization(n)


count = 0
temp = 1


for a,b in st:

    while 1/2*(temp)*(temp +1) <= b:
        temp += 1
    count += temp-1
    temp = 1

print(count)

Solution (Python):

import collections

def factorize(target_number):
    factor_list = []
    while target_number % 2 == 0:
        factor_list.append(2)
        target_number //= 2
    factor = 3
    while factor * factor <= target_number:
        while target_number % factor == 0:
            target_number //= factor
            factor_list.append(factor)
        factor += 2
    if target_number > 1:
        factor_list.append(target_number)
    return factor_list

N = int(input())

fact_list = factorize(N)

fact_counter_dict = collections.Counter(fact_list)
ans = 0
for fact, freq in fact_counter_dict.items():
    freq_copy = freq
    for i in range(1, freq + 1):
        freq_copy -= i
        if freq_copy < 0:
            break
        ans += 1
print(ans)

Solution (Python):
import math

def tri_num(num):
    t = c = 0
    while t + c < num:
        c += 1
        t += c
    return c

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

    pf = {}
    m = N
    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 i in pf.values():
        ans += tri_num(i)

    print(ans)
    
if __name__ == "__main__":
    main()

Solution (Python):

import collections

def factorize(target_number):
    factor = 2
    factor_list = []
    while factor * factor <= target_number:
        while target_number % factor == 0:
            target_number //= factor
            factor_list.append(factor)
        factor += 1
    if target_number > 1:
        factor_list.append(target_number)
    return factor_list

N = int(input())

fact_list = factorize(N)

fact_counter_dict = collections.Counter(fact_list)
ans = 0
for fact, freq in fact_counter_dict.items():
    freq_copy = freq
    for i in range(1, freq + 1):
        freq_copy -= i
        if freq_copy < 0:
            break
        ans += 1
print(ans)

Solution (Python):
import math
from sys import exit

n=int(input())
primes = {}
i = 2
ans = 0
square = math.floor(math.sqrt(n))

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

primes = factorization(n)
if len(primes) == 0:
    print(1)
    exit()

for k,v in primes:
    base = v * 2
    root = math.floor(math.sqrt(base))
    if root * (root + 1) > base:
        root -= 1
    ans += root

print(ans)

Solution (Python):
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
n=int(input())
if n==1:
    ans=0
else:
    a=prime_factorize(n)
    if a==[]:
        ans=1
    else:
        ans=0
        xzen=a[0]
        count=1
        ans+=1
        for x in range(1,len(a)):
            if xzen==a[x]:
                count+=1
                if count==3 or count==6 or count==10 or count==15 or count==21 or count==28 or count==36:
                    ans+=1
            else:
                xzen=a[x]
                count=1
                ans+=1
print(ans)

Solution (Python):
from collections import Counter
def p(n):
    a=[]
    i=2
    while i*i<=n:
        while n%i==0:
            a.append(i)
            n//=i
        i+=1
    if n>1:
        a.append(n)
    return a
N=int(input())
c=Counter(p(N))
ans=0
for k,v in c.items():
    j=0
    for i in range(1,100000):
        j+=i
        if j>v:
            break
        ans+=1
print(ans)

Solution (Python):
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()

from collections import defaultdict, deque, Counter
from sys import exit
import heapq
import math
import copy
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7

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


def factime(ny):
    cnt = 1
    sum = 0
    while True:
        if sum + cnt > ny:
            return cnt - 1
            break
        sum += cnt
        cnt += 1


def prime_factorize(n):
    divisors = []
    
    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
            divisors.append([i, cnt])
    if temp != 1:
        divisors.append([temp, 1])
    if divisors == []:
        divisors.append([n, 1])

    return divisors

ans = 0
for i in prime_factorize(N):
    ans += factime(i[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())
if N==1:
  print(0)
  exit(0)
c=0
p=factorization(N)

for i in range(len(p)):
    r=1
    s=0
    while 1:
        s+=r
        if p[i][1]>=s:
            N/=pow(p[i][0],r)
            
            c+=1
            r+=1
        else:
            break
            
print(c)

Solution (Python):
import numpy as np


import itertools
import copy

n = int(input())



def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1

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

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

nums = factorization(n)

ans = 0

for i in range(len(nums)):
    num = nums[i][1]

    for j in range(1,10*8):
        num -= j
        ans += 1
        if (num < j+1):
            break

print(ans)

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

        if n % f == 0:
            cnt += 1
            n //= f
        else:
            f += 2
            if cnt > 0:
                a.append(cnt)
            cnt = 0

    if n != 1:
        a.append(1)
    return a

n = int(input())
ans = 0
lis = prime_factorize(n)


for i in range(len(lis)):
    val = 1
    while val <= lis[i]:
        lis[i] -= val
        val += 1
        ans += 1
print(ans)

Solution (Python):
from collections import Counter

def 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())
arr = dict(Counter(factorize(N)))
ans = 0

for v, c in arr.items():
    z = 0
    for i in range(1, c+1):
        z += i
        if c - z < 0:
            break
        ans += 1
print(ans)

Solution (Python):
import collections as cl

N = int(input())
res = 0
def prime(N):
    l = []
    p = 2
    while N % 2 == 0:
        l.append(p)
        N //= p
    p += 1
    while p * p <= N:
        if N % p == 0:
            l.append(p)
            N //= p
        else:
            p += 2
    if N != 1:
        l.append(N)
    return l

c = cl.Counter(prime(N))

for k,v in c.items():
    i = 1
    while i <= v:
        res += 1
        v -= i
        i += 1

print(res)

Solution (Python):
from collections import Counter

def factorize(N):
    p = 2
    PRIME = []
    while p * p <= N:
        if N % p == 0:
            N //= p
            PRIME.append(p)
        else:
            p += 1
    if N > 1:
        PRIME.append(N)
    return Counter(PRIME)

n = int(input())

prime = factorize(n)
ans = 0
for i in prime:
    for j in range(1,prime[i]+1):
        if n % i ** j == 0:
            n //= i ** j
            ans += 1
print(ans)

Solution (Python):
import math

n = int(input())
N = n

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

yakusu = []
multi = []

i = 2

while(i <= math.ceil(math.sqrt(N))):
    
    if(n % i == 0):
        if(i in yakusu):
            multi[yakusu.index(i)] += 1
        else:
            yakusu.append(i)
            multi.append(1)
        n = int(n / i)
        continue
    
    if(n == 1):
        break
    
    i += 1
    
else:
    yakusu.append(n)
    multi.append(1)

if(len(yakusu) == 0):
    print(1)
    exit()
    



ans = 0

for j in range(len(multi)):
    h = (-1 + int(math.sqrt(1 + 8 * multi[j]))) / 2
    ans += int(h)

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

cnt = 0
for f in fact:
  if f[0] == 1:
    continue
  fa = f[ 1 ]
  i = 1
  while fa > 0:
    fa -= i
    i += 1
    if fa >= 0:
      cnt += 1
    
print( cnt )

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

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

if arr==[[1,1]]:
    print(0)

else:
    total=0
    for i in range(len(arr)):
        x=1
        s=0
        c=-1
        while s<=arr[i][1]:
            s+=x
            x+=1
            c+=1
        total+=c
    print(total)

Solution (Python):
from collections import Counter

def 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())
arr = dict(Counter(factorize(N)))
ans = 0

for v, c in arr.items():
    count=0
    z = c
    for i in range(55):
        z -= i
        if z < 0:
            break
        count = i
    ans+=count
print(ans)

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

def factorizatio(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
for i in factorizatio(N):
    cnt = i[1]
    a = 0
    b = 0
    for j in range(1, cnt+1):
        a += j            
        if a > cnt:
            break
        b += 1    
    ans += b

print(0 if N == 1 else ans)

Solution (Python):
n=int(input())
d={}
for k in range(2,10**6):
  while n%k<1: n//=k; d[k]=d.get(k,0)+1
a=0
for i in d.values():
  t=c=0
  while t+c<i: c+=1; t+=c
  a+=c
print(a+(n>1))

Solution (Python):
from collections import Counter
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
b = prime_factorize(N)
mycounter = Counter(b)
c = mycounter.most_common()
m = list(range(1,100))
count = 0
for i, j in c:
    sum = 0
    for k in m:
        sum += k
        if j < sum:
            count += k-1
            break
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


N = int(input())


fact_arr = factorization(N)
count = 0


for f in fact_arr:
    c = f[1]
    tmp_count = 0
    i = 1
    while c-i>=0:
        c -= i
        tmp_count += 1
        i += 1
    count += tmp_count


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