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):
from collections import Counter


def prime_factorization(n):
    counter = Counter()
    max_pp = n
    while n % 2 == 0:
        counter[2] += 1
        n //= 2
    p = 3
    while p ** 2 <= max_pp:
        if n % p == 0:
            counter[p] += 1
            n //= p
        else:
            p += 2
    if n != 1:
        counter[n] += 1
    return counter


N = int(input())
prime_counter = prime_factorization(N)
ans = 0
for key in prime_counter.keys():
    for e in range(1, N):
        if prime_counter[key] >= e:
            prime_counter[key] -= e
            ans += 1
            e += 1
        else:
            break

print(ans)

Solution (Python):
import sys
N = int(sys.stdin.readline().rstrip())

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

primes = prime_factorize(N)

from collections import Counter

cnts = Counter(primes)
ans = 0
for p, cnt in cnts.items():
    tmp = 1
    while cnt - tmp >= 0:
        cnt -= tmp
        tmp += 1
        ans += 1
print(ans)

Solution (Python):
import sys
from collections import defaultdict

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60

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

def main():
    N = int(readline())
    a = prime_factorize(N)
    
    ans = 0
    for power in a.values():
        ans += int(((1 + 8 * power) ** 0.5 - 1 ) / 2)
        
    print(ans)
    return


if __name__ == '__main__':
    main()

Solution (Python):
import math


import math
import numpy as np
from collections import deque
def sieve_of_erastosthenes(num):
    """
    エラストネスの篩
    :param num:
    :return:
    """
    input_list = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(num)]
    input_list[0] = input_list[1] = False

    input_list[2] = input_list[3] = input_list[5] = True
    sqrt = math.sqrt(num)

    for serial in range(3, num, 2):

        if serial >= sqrt:
            return input_list

        for s in range(serial ** 2, num, serial):
            input_list[s] = False
    return input_list

N=int(input())

def factorization(n):
    """

    素因数分解
    :param n:
    :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[i]= cnt

    if temp!=1:
        arr[temp]= 1

    if arr=={}:
        arr[n]= 1

    return arr

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

input_ = make_divisors(N)
cnt = 0














if N ==1:
    print(0)
    exit()
prime_dict = factorization(N)

searched = []
count=0
for prime, val in prime_dict.items():
    for e in range(1 ,val+1):

        z = prime ** e

        if N%z == 0 and not z in searched:
            searched.append(z)
            N = N//z
            count += 1
print(count)

Solution (Python):
from collections import Counter

N = int(input())

n = N
counter = Counter()
while n % 2 == 0:
    counter[2] += 1
    n //= 2
p = 3
while p ** 2 <= N:
    if n % p == 0:
        counter[p] += 1
        n //= p
    else:
        p += 2
if n != 1:
    counter[N] += 1

ans = 0
for key in counter.keys():
    e = 1
    while counter[key] >= e:
        ans += 1
        counter[key] -= e
        e += 1

print(ans)

Solution (Python):
import sys
from collections import defaultdict

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60


def prime_numbers(n):
    if n < 2:
        return []

    m = (n + 1) // 2
    p = [1] * m
    for i in range(1, int((n ** 0.5 - 1) / 2) + 1):
        if p[i]:
            p[2 * i * (i + 1) :: 2 * i + 1] = [0] * (((m - 1) - 2 * i * (i + 1)) // (2 * i + 1) + 1)

    a = [2 * i + 1 for i in range(m) if p[i]]
    a[0] = 2
    return a


def prime_factorize(n):
    a = defaultdict(int)
    primes = prime_numbers(int(n ** 0.5) + 1)
    for p in primes:
        while n % p == 0:
            a[p] += 1
            n //= p
        if n == 1:
            break
    if n != 1:
        a[n] += 1
    return a


def main():
    N = int(readline())
    a = prime_factorize(N)

    ans = 0
    for power in a.values():
        ans += int(((1 + 8 * power) ** 0.5 - 1) / 2)

    print(ans)
    return


if __name__ == '__main__':
    main()

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

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

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

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

    return a

result = factorization(N)

count = 0
for p, i in result:
    if p == 1:
        continue
    s = 0
    for k in range(1, i+1):
        if s + k > i:
            break
        else:
            N /= p ** k
            count += 1
            s += k
print(count)

Solution (Python):
n = int(input())
res = 0
for i in range(2, int(n**0.5)+1):
    if n%i == 0:
        e = 0
        while n%i == 0:
            n //= i
            e += 1
        tmp = 0
        for i in range(1, e+1):
            if e >= i:
                e -= i
                tmp += 1
        res += tmp
if n > 1: res += 1
print(res)

Solution (Python):


import sys
import math
from collections import Counter
import itertools
import fractions
from decimal import *




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 LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'


p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")


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=II()


ans = factorization(N)

cnt = 0

for an in ans:
    if an[0] != 1:
        k = an[1]
        i = 1
        flg = True
        while flg:
            if k - i >= 0:
                k-=i
                cnt+=1
                i+=1
            else:
                flg = False
        


print(cnt)

Solution (Python):

import math

n=int(input())
N=n
if n==1:
    print(0)
    exit()
ans=0
z=[]
for i in range(2,int(math.sqrt(N))+1):
    if n%i==0:
        x=i
        s=0
        while n>=1:
            if n%x==0:
                
                n=n//x
                s+=1
                
            else:
                
                z.append(s)
                break
    if n==1:
        break


if len(z)==0:
    print(1)
    exit()
for i in range(len(z)):
    j=1
    while z[i]>0:
        ans+=1
        z[i]-=j
        j+=1
        if z[i]<j:
            break
if n>math.sqrt(N):
    ans+=1

print(ans)

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

def prime_factorization(n):
    d = {}
    i = 2
    while i * i <= n:
        if n % i == 0:
            d[i] = 1
            n //= i
            while n % i == 0:
                n //= i
                d[i] += 1
        i += 1
    if n > 1:
        d[n] = 1
    return d

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

    d = prime_factorization(N)
    
    ans = 0
    for k, v in d.items():
        e = 0
        for i in range(1, v+1):
            e += i
            if e > v:
                break
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
import sys 
from collections import Counter
input = sys.stdin.readline
n = int(input())
m = int(n**0.5)

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:
    ans = 0
else:
    ans = 0
    a = prime_factorize(n)
    c = Counter(a)
    for val in c.values():
        j = 1
        while j*(j+1)//2 <= val:
            j += 1
        ans += j-1
print(ans)

Solution (Python):


import sys
import math
from collections import Counter
import itertools
import fractions
from decimal import *




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 LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'


p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")


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=II()
if N == 1:
    print(0)
    exit()

ans = factorization(N)

cnt = 0

for an in ans:
    p = an[0]
    e = an[1]
    num = 1
    while e >= num:
        e -= num
        cnt += 1
        num += 1
        


print(cnt)

Solution (Python):
N=int(input())
nn=N
import math
sq=round(math.sqrt(N))+1

i=2
ans=0
count1=0
count2=1
while sq>=i:
    if nn%i==0:
        nn//=i
        count1+=1
        if count1==count2:
            ans+=1
            count2+=1
            count1=0
    else:
        i+=1
        count1=0
        count2=1

if nn>sq:
    ans+=1

print(ans)

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

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


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


li = fac(n)
kaijo = [0, 1, 3, 6, 10, 15, 21, 28, 36, 45]

for i in range(len(li)):
    for j in range(len(kaijo)):
        if kaijo[j] <= li[i][1] < kaijo[j + 1]:
            ans += j

print(ans)

Solution (Python):
import math

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

n = int(input())
p = factorization(n)
ans = 0
if p[0][0] == 1:
    ans = 0
else:
    for x in p:
        i = 1
        s = x[1]
        while s >= i:
            s -= i
            i += 1
        ans += (i-1)
print(ans)

Solution (Python):
from collections import Counter

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

def get_count(c):
  ans = 0
  _max = c
  for i in range(1,c+1):
    if i <= _max:
      ans += 1
      _max -= i
    else:
      break
  return ans
a = int(input())
counter = Counter(prime_factor(a))
ans = 0
for i in counter:
  ans += get_count(counter[i])
print(ans)

Solution (Python):

def main():
    import sys
    imput = sys.stdin.readline
    
    
    
    N = int(input())

    
    

    import math
    from collections import Counter

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

    s = Counter(prime_factors(N))

    def triangle(n):
        i = 1
        while i*(i+1)//2 <= n:
            i += 1
        return i-1

    answer = 0
    for l in s.values():
        answer += triangle(l)

    print(answer)

    
if __name__ == "__main__":
    main()

Solution (Python):

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



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 or n == 0:
    print(0)
    exit()
if pri_me(n):
    print(1)
    exit()
N = n
ans = 0
from collections import Counter
d=prime_factorize(n)
d = sorted(d)
for i in set(d):
    cnt = d.count(i)
    now = 1
    k = 1
    while now <=cnt:
        ans += 1
        k+=1
        now += k
print(ans)

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

element = int(math.sqrt(n))
nk = n
i = 2
p = []
while nk>1 and i <= element:
    if nk % i == 0:
        p.append(i)
        while nk % i == 0:
            nk //= i
    i += 1
if nk > 1:
    p.append(nk)
ans = 0
option = [[k, k] for k in p]
heapq.heapify(option)
while n>1 and option:
    val, p = heapq.heappop(option)
    
    if val*p <= n:
        heapq.heappush(option, [val*p, p])
    if n % val == 0:
        ans += 1
        n //= val
print(ans)

Solution (Python):
import math
n = int(input())
if n == 1:
  print(0)
  exit(0)
  
pows = []
upto = int(math.sqrt(n))
for i in range(2, upto+1):
  if n % i == 0:
    cc = 0
    while n % i == 0:
      n //= i
      cc += 1
    pows.append(cc)
    

if n != 1:
  pows.append(1)
    
if len(pows) == 0:
  print(1)
  exit(0)
  
ans = 0
for pp in pows:
  start = 1
  cc = 0
  while pp - start >= 0:
    cc += 1
    pp -= start
    start += 1

  ans += cc

print(ans)

Solution (Python):

n = int(input())

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

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

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

    return arr
def suretu(n):
    a = []
    i = 1
    while True:
        n  = n - i
        if n >= 0:
            a.append(i)
            i += 1
        else:
            break
    return a
f = factorization(n)
flg = True

cnt = 0
if f == [[1,1]]:
    print(0)
else:
    for i in range(len(f)):
        cnt += len(suretu(f[i][1]))
    print(cnt)

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 cnt(num):
    i=1
    co=0
    while num>=0:
        num-=i
        co+=1
        i+=1
    return co-1

n=int(input())
c=Counter(prime_factorize(n))
l=list(c.values())
r=0
for x in l:
    r+=cnt(x)
print(r)

Solution (Python):
"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の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)
else:
    a=factorization(N)

    ans=0

    for j in range(len(a)):
        for k in range(1000000000000000):
            a[j][1]-=k
            ans+=1
            if a[j][1]-(k+1)<0:
                ans-=1
                break
    print(ans)

Solution (Python):
from math import sqrt
import itertools

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

    return factors


N = int(input())
factors = factorization(N)
count = 0
for a, b in factors:
    c = 0
    for i in itertools.count(1):
        c += i
        if c > b:
            break
        else:
            count += 1

if N == 1:
    print(0)
else:
    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 not arr:
        arr.append([n, 1])

    return arr


n = int(input())
cnt = 0
z_list = []
f = factorization(n)
for fact in f:
    for j in range(1, fact[1] + 1):
        z = fact[0] ** j
        if z < 2:
            print(0)
            exit()
        if str(z) not in z_list:
            if n % z == 0:
                n = n // z
                cnt += 1
print(cnt)

Solution (Python):
import math
def check(n):
    count = 0
    end = int(math.sqrt(n)+1)
    for i in range(2,end):
        if n%i==0:
            count += 1
            n/=i
        if n%i==0:
            l = 2
            count2 = 0
            while n%i==0:
                n/=i
                count2+=1
                if count2==l:
                    count+=1
                    count2=0
                    l+=1
        if n==1:
            return count
    if n==1:
        return 0
    if count==0:
        return 1
    else:
        return count+1   
n = int(input())
ans = check(n)
print(ans)

Solution (Python):
import numpy as np
import math
import copy 

N = np.int64(input())

p = []
x  = 2
xen = np.sqrt(N)
while N > 1 : 
    if N%x == 0 :
        p.append(x)
        N = N/x
    else :
        x = x + 1
        if x > xen :
            p.append(int(N))
            break
e = []
while p!=[]:
    i = p[0]
    n = p.count(i)
    p = p[n:]
    e.append(n)
    if p==[]:break

i = 0
m = 0
e = np.array(e)
ans = 0
while True:
    i += 1
    e = e-i
    e = e[e>=0]
    ans = ans + len(e)
    if len(e)==0 : break

print(ans)

Solution (Python):
N=int(input())
C=[0]*(10**6+1)
n=[i for i in range(50)]
n[0]=1
for i in range(40):
    n[i+1]+=(n[i]+1)
for i in range(2,int(N**0.5)+1):
    if N%i==0:
        while N%i==0:
            C[i]+=1
            N//=i
res=0
for c in C:
    if c>0:
        for i in range(50):
            if c<n[i]:
                res+=i
                break
print(res+1 if N>1 else res)

Solution (Python):

import sys
def _p(*_a):
  _s=" ".join(map(str,_a))
  
  sys.stderr.write(_s+"\n")

import math

def factorize(n):
  ret, a = [], n
  for i in range(2, int(n**0.5)+1):
    if a%i>0: continue
    c=0
    while a%i==0:
      a//=i
      c+=1
    else:
      ret.append((i,c))
  if a!=1: ret.append((a,1))
  return ret


n = int(input())
N = factorize(n)

ans=0
for p,i in N:
  for j in range(i):
    a = pow(p,j+1)

    if a > n: break

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


print(ans)

Solution (Python):
N=int(input())
C=[]
n=[i for i in range(50)]
n[0]=1
for i in range(49):
    n[i+1]+=(n[i]+1)
for i in range(2,int(N**0.5)+1):
    if N%i==0:
        while N%i==0:
            C.append(i)
            N//=i
D=set(C)
E=[]
for d in D:
    E.append(C.count(d))
res=0
for e in E:
    for i in range(50):
            if n[i]<=e<n[i+1]:
                res+=i+1
                break
                
print(res+1 if N>1 else res)

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

Solution (Python):

import sys
def _p(*_a):
  _s=" ".join(map(str,_a))
  
  sys.stderr.write(_s+"\n")

import math

def factorize(n):
  ret, a = [], n
  for i in range(2, int(n**0.5)+1):
    if a%i>0: continue
    c=0
    while a%i==0:
      a//=i
      c+=1
    else:
      ret.append((i,c))
  if a!=1: ret.append((a,1))
  return ret


n = int(input())
N = factorize(n)

ans=0
for p,i in N:
  for j in range(i):
    a = pow(p,j+1)
    if n % a == 0:
      n /= a
      ans += 1

print(ans)

Solution (Python):
import numpy as np
import math
import copy 
N = input()
N = np.int64(N)

l = []
x  = 2
xen = np.sqrt(N)
while N>1:
    if N%x ==0:
        l.append(x)
        N = N/x
    else:
        x = x + 1
        if x > xen:
            l.append(int(N))
            break


l2 = []
while l!=[]:

    i = l[0]
    n = l.count(i)
    l = l[n:]
    l2.append(n)
    if l==[]:break



i = 0
m = 0
l2 = np.array(l2)

ans = 0
while True:
    i += 1


    l2 = l2-i
    l2 = l2[l2>=0]
    ans = ans + len(l2)

    if len(l2)==0:break
print(ans)

Solution (Python):
import collections
import math

n = int(input())
B = [1,3,6,10,15,21,28,36,45,55,66,78,91,105]
ans = 0

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True
if is_prime(n) == True:
  print(1)
  exit()

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))  
for v in c.values():
  for j in range(len(B)):
    if v < B[j]:
      ans += j
      break
      
print(ans)

Solution (Python):
def prime_factorize(n):
    if 2 <= n < 4:
        return [n]
    res = []
    i = 2
    while i * i <= n:
        while n % i == 0:
            res.append(i)
            n //= i
        i += 1
    if n != 1:
        res.append(n)
    
    return res

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

if __name__ == "__main__":
    resolve()

Solution (Python):
import math
"nの約数列挙"
def divisor(n):
    ass = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            ass.append(i)
            if i**2 == n:
                continue
            ass.append(n//i)
    return ass

"nの素因数分解"
def prime_factor(n):
    ass = []
    for i in range(2,int(n**0.5)+1):
        while n % i==0:
            ass.append(i)
            n = n//i
    if n != 1:
        ass.append(n)
    return ass

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


import collections
N = int(input())
A = prime_factor(N)
A.sort()
c = collections.Counter(A)
ans = 0
for x in c.values():
  count = 1
  while x > 0:
    x -= count
    if x >= 0:
      count +=1
      ans += 1

print(ans)

Solution (Python):
from collections import Counter
n = int(input())
tmp = n
d = []
for i in range(2, int(n ** 0.5) + 1):
    if tmp % i == 0:
        while tmp % i == 0:
            d.append(i)
            tmp //= i
if tmp != 1:
    d.append(tmp)

dv = Counter(d)

cnt = 0
for p in dv.keys():
    for e in range(1, dv[p]+1):
        z = p ** e
        if n % z == 0:
            cnt += 1
            n //= z

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()
z = factorization(n)
cnt = 0
for item in z:
    p = item[0]
    e = item[1]
    num = 1
    while e >= num:
        e -= num
        cnt += 1
        num += 1

print(cnt)

Solution (Python):


import math
from collections import Counter
n = int(input()) 
val = n
l = []

i = 2
while i <= int(math.sqrt(n)):
    if n % i == 0:
        n //= i
        l.append(str(i))
    else:
        i += 1

if n != 1:
    l.append(str(n))

answer = 0

for a, b in Counter(l).items():
    z = 0
    for i in range(1, b+1):
        z += i
        if b - z < 0:
            break
        answer += 1
print(answer)

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

cnt = 0
a = factorization(n)
if n == 1:
  print(0)
  exit()

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

Solution (Python):
from collections import Counter

def Eratosthenes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n ** 0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

n = int(input())
n2 = n

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

prime_factors = [] 
for i in Eratosthenes(int(n ** 0.5)):
    if i**2 > n2:
        break
    while n2 % i == 0:
        prime_factors.append(i)
        n2 //= i
if n2 > 1:
    prime_factors.append(n2)



cntr = Counter(prime_factors)
cnt = 0

for v in cntr.values():
    sisuu = v
    sub = 1
    while sisuu - sub >= 0:
        sisuu -= sub
        cnt += 1
        sub += 1
print(cnt)
"""
ans = []
list = []
for i in prime_factors:
    for j in list:
        if j % i == 0:
            tmp = list.pop(list.index(j)) * i
            if tmp in ans:
                list.append(tmp)
                continue
            ans.append(tmp)
    if i in list:
        tmp = list.pop(list.index(i)) * i
        if tmp in ans:
            list.append(tmp)
            continue
        ans.append(tmp)
    elif i in ans:
        list.append(i)
    else:
        ans.append(i)

print(len(ans))
"""

Solution (Python):

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

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

if __name__ == "__main__":
    resolve()

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
 
def renzoku(n):
    x = (-1+(1+8*n)**(0.5))//2
    return int(x)
      
N = int(input())
if N == 1:
  print("0")
  sys.exit()
oriN = N*1
A = factorization(N)

M = len(A)
 
ans = 0
for i in range(M):
  temp = A[i][1]
  f = renzoku(temp)
  ans += f
print(ans)

Solution (Python):
n = int(input())
d = 2
ans = 0

while d ** 2 <= 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)