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):
def main():
    from sys import setrecursionlimit, stdin
    from os import environ
    from collections import defaultdict, deque, Counter
    from math import ceil, floor, gcd
    from itertools import accumulate, combinations, combinations_with_replacement
    setrecursionlimit(10**6)
    dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in environ else lambda *x: 0
    input = lambda: stdin.readline().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    P = 10**9+7
    INF = 10**9+10

    def sieve_of_eratosthenes(upper_bound):
        upper_bound += 1
        P = [True] * upper_bound
        P[0] = P[1] = False
        for i in range(4,upper_bound,2):
            P[i] = False
        for i in range(3,int(upper_bound**0.5),2):
            if P[i]:
                for j in range(i**2,upper_bound,i):
                    P[j] = False
        res = []
        for i in range(upper_bound):
            if P[i]:
                res.append(i)
        return res






    N = II()
    primes = deque()
    p_counts = deque()
    tmp = N
    if tmp % 2 == 0:
        c = 0
        while tmp % 2 == 0:
            tmp //= 2
            c += 1
        primes.append(2)
        p_counts.append(c)
        
    for i in range(3,int(N**0.5)+1,2):
        c = 0
        if tmp % i == 0:
            while tmp % i == 0:
                tmp //= i
                c += 1
            primes.append(i)
            p_counts.append(c)

    if tmp != 1:
        primes.append(tmp)
        p_counts.append(1)



    ans = 0



    for i in p_counts:
        max_num = 1
        while (1+max_num)*max_num//2 <= i:
            max_num += 1

        ans += max_num-1
    print(ans)
            



    
main()

Solution (Python):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy

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

def make_divisors(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

if __name__ == "__main__":
    n = int(input())
    a = list(set(prime_factorize(n)))
    a.sort()
    cnt = 0
    for i in range(len(a)):
        e = 1
        while n%(a[i]**e) == 0:
            n = n//a[i]**e
            e += 1
            cnt+=1
    print(cnt)

Solution (Python):
import math
def factorization(n):
    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

def ston(s):
  return (-1+math.sqrt(1+8*s))/2

n = int(input())

s = 0
soinsu = factorization(n)

for i in soinsu:
  num = int(ston(i[1]))
  s += num
  
print(s)

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

p = [0]*10**6
for i in range(2, 10**6):
    if p[i] == 0:
        p[i] = 1
        j = 2
        while i*j < 10**6:
            p[i*j] = -1
            j += 1

ans = 0
for i in range(10**6):
    if p[i] < 1:
        continue
    j = 1
    while N%pow(i, j) == 0:
        N //= pow(i, j)
        j += 1
        ans += 1

for i in range(10**6):
    if p[i] < 1:
        continue
    while N%i == 0:
        N //= i
    
if N > 10**6:
    i = 2
    f = True
    while i <= N**0.5:
        if N%i == 0:
            f = False
            break
        i += 1
    if f:
        ans += 1

print(ans)

Solution (Python):
from collections import defaultdict

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

index = int(pow(N, 0.5) + 1)
ans = []
for i in range(2, index):
    while N % i == 0:
        N //= i
        ans.append(i)

if N != 1:
    ans.append(N)

if ans == []:
    print(1)
    exit()
d = defaultdict(int)
for i in ans:
    d[i] += 1

sosuLst = []
for v, c in d.items():
    cnt = 1
    while c > 0:
        c -= cnt
        cnt += 1
        if c != 0 and c < cnt:
            sosuLst.append(v ** cnt)
            break
        else:
            sosuLst.append(v ** (cnt - 1))

print(len(set(sosuLst)))

Solution (Python):
import math 

def prime(n):
    
    while n % 2 == 0: 
        if 2 in lis:
            lis[2] = lis[2] + 1
        else:
            lis[2] = 1
            
        n = n // 2

    for i in range(3,int(math.sqrt(n))+1,2): 
          
        while n % i== 0: 
            if i in lis:
                lis[i] = lis[i] + 1
            else:
                lis[i] = 1
            n = n // i 

    if n > 2: 
        if n in lis:
            lis[n] = lis[n] + 1
        else:
            lis[n] = 1


x = int(input())
lis = {}
prime(x)
total = 0

for i in lis:
    temp = 0
    rSum = 0

    while lis[i] > rSum:
        temp = temp + 1
        rSum = rSum + temp

    if lis[i] == rSum:
        total = total + temp
    else:
        total = total + temp-1

print(total)

Solution (Python):

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

    if tmp != 1:
        ret.append([tmp, 1])
    if ret == []:
        ret.append[n, 1]

    return ret


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

    if n == 1:
        print(0)
    else:
        f_list = factorization(n)
        p_list = []
        for f in f_list:
            p_list.append(f[1])

        cnt = 0
        for p in p_list:
            i = 1
            while p > 0:
                if p - i >= 0:
                    cnt += 1
                p -= i
                i += 1

        print(cnt)

if __name__ == '__main__':
    main()

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

def factorization_in_prime_number(x):
    prime_factor = []
    degree = 0
    while x % 2 == 0:
        x //= 2
        degree += 1
    if degree:
        prime_factor.append((2, degree))
    m = int(x**.5) + 1
    for i in range(3, m, 2):
        degree = 0
        while x % i == 0:
            x //= i
            degree += 1
        if degree:
            prime_factor.append((i, degree))
    if x != 1:
        prime_factor.append((x, 1))
    return prime_factor


z = factorization_in_prime_number(N)
ans = 0
for x, i in z:
    cnt = 0
    while cnt*(1+cnt)/2 < i:
        cnt += 1
    if cnt*(1+cnt)/2 > i:
        cnt -= 1
    
    ans += cnt
print(ans)

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

ib = factorization(N)

ans = 0
for i in ib:
    count = 0
    tousa = 0
    while int(tousa) <= i[1]:
        count += 1
        tousa = (count*(count+1))/2
    ans += (count-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())

c = Counter(prime_factorize(N))
keys = c.keys()
ans = 0

for key in keys:
    cnt = 0
    while c[key] >= cnt + 1:
        ans += 1
        c[key] -= (cnt + 1)
        cnt += 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())
f = factorization(n)

ans = 0
for a,b in f:
    if a > 1:
        i = 1
        t = 0
        while True:
            if b - i >= 0:
                t += 1
                b -= i
                i += 1
            else:
                break

        
        ans += t

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())
t=prime_factorize(n)
t.append(0)
count=0
num=1
answer=0
for i in range(len(t)-1):
    if num==1:
        answer+=1
        if t[i]==t[i+1]:
            num+=1
    else:
        count+=1
        if t[i]!=t[i+1] and count!=num:
            num=1
            count=0
        elif count==num:
            answer+=1
            count=0
            if t[i]==t[i+1]:
                num+=1
            else:
                num=1
if n==1:
    answer=0
print(answer)

Solution (Python):
import math


def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    N = read_int()
    if N == 1:
        return 0
    max_divisor = math.sqrt(N)
    divisor = 2
    counter = 0
    while divisor <= max_divisor:
        temp_divisor = divisor
        while N%temp_divisor == 0:
            N //= temp_divisor
            temp_divisor *= divisor
            counter += 1
        while N%divisor == 0:
            N //= divisor
        divisor += 1
    if N != 1:
        counter += 1
    return counter


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

Solution (Python):
import sys



import math

sys.setrecursionlimit(10000)

def solve(n, start):
    if n == 1:
        return 0

    for i in range(start, int(math.sqrt(n+1))):
        sys.stderr.write('i = {}\n'.format(i))

        if n % i == 0:
            
            sys.stderr.write('hit: n = {}, i = {}^1\n'.format(n, i))
            sys.stderr.write('hit: {}^1\n'.format(i))
            cnt = 1
            tmp = n // i
            while(tmp % (i ** (cnt+1)) == 0):
                sys.stderr.write('hit: {}^{}\n'.format(i, cnt+1))
                tmp = tmp // (i ** (cnt+1))
                cnt += 1

            while(tmp % i == 0):
                tmp = tmp // i

            return solve(tmp, i+1) + cnt

    return 1

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

    ans = solve(N, 2)
    print(ans)

    

    
    
    
    

    return 0

if __name__ == '__main__':
    sys.exit(main())

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

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

ind = []
ans = 0
for x in range(1,10):
    ans += x
    ind.append(ans)

cnt = 0
for y in c.values():
    for j,x in enumerate(ind):
        if y < x:
            cnt += j
            break

print(cnt)

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


def simple_factrization(n):
    table = []  
    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

            table.append([i, cnt])

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

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

    return table


f = simple_factrization(N)

count = 0
for i, f_i in enumerate(f):

    tmp_f_i = f_i[1]

    for j in range(1, f_i[1] + 1):
        tmp_f_i -= j
        if tmp_f_i < 0:
            break
        count += 1

print(count)

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


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

    A = prime_factorize(n)
    AC = Counter(A)

    ans = 0
    for v in AC.values():
        k = 1
        while True:
            v -= k
            if v < 0:
                break

            ans += 1
            k += 1

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
from sys import stdin, stdout
import math

def primeFactors(n): 
    ans = []
    
    while n % 2 == 0: 
        ans.append(2) 
        n = n / 2
          
    
    
    for i in range(3,int(math.sqrt(n))+1,2): 
          
        
        while n % i== 0: 
            ans.append(i)
            n = n / i 
              
    
    
    if n > 2: 
        ans.append(int(n))

    return ans 

n = int(stdin.readline())

from collections import Counter

c = Counter(primeFactors(n))


ans = 0
t = list(c.keys())

for key in t:
    i = 1
    while c[key]!=0:
        if c[key]>=i:
            c[key] -= i
            ans += 1
            i += 1

        else:
            if c[key]%2 == 1:
                c[key] -= 1
            
            if c[key] == 0:
                del c[key]
            break

print(ans)

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

c1 = collections.Counter(prime_factorize(N))
ans = 0
c = list(c1.values())


for i in c:
    k = 1
    while True:
        i =i - k
        if i >=0:
            ans += 1
            k += 1
        else:
            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


tmp = 0
ls = [0]
for i in range(1,41):
    tmp += i
    ls += [i]*(i+1)



N = int(input())
if N == 1:
    print(0)
else:
    fac = factorization(N)
    ans = 0
    for p in fac:
        ans += ls[p[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(cnt)

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

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

    return arr

n = int(input())
if n == 1:
  print(0)
  exit()
f = factorization(n)
ans = 0
sum_list = [1, 3, 6, 10, 15, 21, 28, 36, 45]
for i in f:
  for j, m in enumerate(sum_list):
    if i < m:
      ans += j
      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

n = int(input())
if n == 1:
    print(0)
else:
    answer = 0
    for factor in factorization(n):
        x = factor[1]
        kouho = int((2*x)**0.5)-1
        if (kouho)*(kouho+1)/2 <=x and x < (kouho+1)*(kouho+2)/2:
            kaisu = kouho
        else:
            kaisu = kouho+1
        answer += kaisu

    print(answer)

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

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

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

    return arr




N = int(input())
sosuu = factorization(N)

ans = 0

for partial in sosuu:
    
    partial_count = 0
    if partial[0] == 1:
        
        ans = 0
        break
    for x in range(1,partial[1]+1):
        partial_count += x
        if partial_count > partial[1]:
            break
        ans += 1

print(ans)

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

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

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

    return arr

n=int(input())
if n==1:
    print(0)
    exit()
ans=factorization(n) 
f=0
for i in range(len(ans)):
    p=ans[i][1]
    j=1
    while p>=j:
        p=p-j
        j+=1
        f+=1
print(f)

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

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

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

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

    return arr

  
table = factorization(N)

if N == 1:
  print(0)
else:
  ans = 0
  for a,b in table:
    cand = int(math.sqrt(2*b))
    cnt = 0
    for i in range(max(0,cand-10),cand+10):
      if 2*b >= i*(i+1):
        cnt=i
      else:
        break
    ans += cnt
  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
ans = factorization(n)
s= 0
for i in range(len(ans)):
    now = 1
    while(ans[i][1] >= 0):
        ans[i][1] -= now
        
        s += 1
        now += 1
    s -= 1
print(s)

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

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

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

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

    return arr

B = factorization(A)
N = len(B)
ans = 0
for n in range(N):
  m =1
  b = B[n][1]
  while b >= ((m+1)*(m+2)//2):
    m+=1
  ans += m
if A==1:
  print(0)
else:
  print(ans)

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
c = collections.Counter(prime_factorize(N))

ans = 0
for i in c.values():
    for j in range(1,i+1):
        i -= j
        if i >= 0:
            ans += 1
        else:
            break

print(ans)

Solution (Python):
n=int(input())
a=[]
t=n
for i in range(2, int(-(-n**0.5//1))+1):
    if t%i==0:
        c=0
        while t%i==0:
            c+=1
            t //= i
        a.append([i,c])

if t!=1:
    a.append([t,1])

if a==[] and t!=1:
    a.append([n, 1])
ans=0
for i in a:
    j = 1
    while i[1]>=0:
        i[1]-=j
        if i[1]>=0:
            ans+=1
            j+=1
print(ans)

Solution (Python):
import collections


N = int(input())


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

C = collections.Counter(prime_factorize(N))

ans = 0
for c in C.values():
    t = c
    for i in range(1, c+1):
        t -= i
        if t >= 0:
            ans += 1
        else:
            break


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

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

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

    return arr

arr = factorization(N)
if N==1:
  arr = []
def solv(c):
    D = (1 - 8*(-c)) ** (1/2)
    x_1 = (-1 + D) / 2
    x_2 = (-1 - D) / 2
    
    return int(max(x_1, x_2))
ans = 0
for i in arr:
  ans += solv(i)

print(ans)

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

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

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

    return arr


n = int(input())

z = []

f = sorted(factorization(n), key=lambda x: x[1], reverse=True)

for i in range(len(f)):
    if f[i][1] < 0:
        f[i][1] = -1 * f[i][1]

for i in range(len(f)):
    for j in range(1, f[i][1] + 1):
        if f[i][0] == 1:
            continue
        f[i][1] -= j
        if f[i][1] >= 0:
            z.append(f[i][0] ** j)

print(len(z))

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

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

x = n ** 0.5
d = {}
z = 2
ans = 0
while True:
    if n % z == 0:
        n //= z
        if d.get(z) == None:
            d[z] = 1
        else:
            d[z] += 1
    else:
        z += 1
    if n == 1:
        break
    if x < z:
        ans = 1
        break
    
for dv in d.values():
    i = 1
    while True:
        dv -= i
        i += 1
        if dv < 0:
            break
        
        ans += 1

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
ans = factorization(n)
s= 0
for i in range(len(ans)):
    now = 1
    while(ans[i][1] >= 0):
        ans[i][1] -= now
        
        s += 1
        now += 1
    s -= 1
print(s)

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

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

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

	return arr

n=int(input())
arr=factorization(n)
num=[1,3,6,10,15,21,28,36,45,55,66]

res=0
for x,y in arr:
	 for i in num:
	 	if y>=i:
	 		res+=1

if n==1:
	print("0")
else:
	print(res)

Solution (Python):
import bisect
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
    ans = 0
    p = factorization(n)

    for i, pp in enumerate(p):
        tmp = pp[1]
        ary = [0] * (tmp+1)
        cnt = 1
        while tmp > 0:
            ans += 1
            tmp -= cnt
            if tmp <= cnt:
                cnt += 1
                break
            if tmp < 0:
                tmp += cnt

            cnt += 1
    print(ans)


if __name__=='__main__':
    main()

Solution (Python):

from collections import Counter
import math

N = int(input())
def prime_factors(n):
    """Returns all the prime factors of a positive integer"""
    factors = []
    d = 2
    while n > 1:
        while n % d == 0:
            factors.append(d)
            n /= d
        d = d + 1
        if d*d > n:
            if n > 1: factors.append(int(n))
            break
    return factors


def count_moves(exponents):
    num = 0
    for ex in exponents:
        num += math.floor(0.5*(math.sqrt(8*ex+1) - 1))

    return num


pf = prime_factors(N)
pf = Counter(pf)
exponents = list(pf.values())
ans = count_moves(exponents)

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())
f=prime_factorize(n)
if len(f)==0:
  print(0)
  exit()
s=set(f)
r=0

def func(m):
  r=0
  for ii in range(m):
    if m>=ii+1:
      m-=(ii+1)
      r+=1
      
    else:
      break
  return r

for ii in s:
  m=f.count(ii)
  fm=func(m)
  
  r+=fm
  
print(r)

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().strip())
    if N == 1:
        return 0
    factors = factorization(N)
    ans = 0
    for factor in factors:
        counter = 1
        while True:
            if factor[1] >= counter:
                factor[1] -= counter
                counter += 1
                ans += 1
            else:
                break
    return ans


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

Solution (Python):
import sys
n=int(input())
if n==1:
    print(0)
    sys.exit()
def f(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
tmp=f(n)
ans=0
for i in tmp:
    dd=i[1]
    tt=1
    while dd>0:
        if dd-tt>=0:
            dd-=tt
            tt+=1
            ans+=1
        else:
            break
print(ans)

Solution (Python):
import numpy as np
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
N = int(input())
if N == 1:
    print(0)
else:
    b = factorization(N)
    count = 0
    for i in b:
        j = 1
        while(1):
            i -= j
            if i<0:
                break
            else:
                count += 1
                j += 1
    print(count)

Solution (Python):
n = int(input())
a = []
b = []
if n == 1:
    print(0)
    exit()
if True:
    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)
kosuu = 1
mae = a[0]
for i in range(1,len(a)):
    if mae == a[i]:
        kosuu += 1
    else:
        mae = a[i]
        b.append(kosuu)
        kosuu = 1
b.append(kosuu)
ans = 0
for i in range(len(b)):
    for j in range(2,100):
        if b[i] < j*(j+1)//2:
            ans += j-1
            break
print(ans)

Solution (Python):

import collections
import itertools as it
import math

 

n  = int(input())






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

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

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

    return arr

f = factorization(n)

if f == [[1, 1]]:
    print(0)
    exit()

ans = 0
for sosu in f:
    p, n_ = sosu

    cur = 1
    for _ in range(n_):
        if cur <= n_:
            ans += 1
            n_ -= cur
            cur += 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())
sum = 0
c = collections.Counter(prime_factorize(n))
index = 1
for i in c.values():
    tmp = i
    
    for j in range(i):
        if j+1 > tmp:
            break
        tmp -= j+1
        sum += 1
print(sum)

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
from collections import Counter
n = int(input())
ans = 0
list_N = prime_factorize(n)
list_Q = Counter(list_N).values()

for num in list_Q:
    k = 0
    while True:
        k += 1
        if num - k < 0:
            break
        num -= k
        ans += 1

print(ans)