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

Solution (Python):
import sys
n=int(input())
if n ==1:
    print("0")
    sys.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

l = factorization(n)
count =0
for i in l:
    cou = 0
    a = i[1]
    hiku = 1
    while a - hiku >=0:
        cou += 1
        a -= hiku
        hiku += 1
    count += cou
print(count)

Solution (Python):
import math
def get_prime(n):
    if n <= 1:
        return []
    prime = [2]
    if n > 2:
        limit = int(math.sqrt(n))
        odd = [i for i in range(3, n + 1, 2)]
        while limit >= odd[0]:
            prime.append(odd[0])
            odd = [j for j in odd if j % odd[0] != 0]
        prime += odd
    return prime

from collections import defaultdict
def prime_factorization(n):
    if n <= 1:
        return {}
    else:
        
        prime = get_prime(int(math.sqrt(n)))
        dct = defaultdict(int)
        for p in prime:
            while n % p == 0:
                dct[p] += 1
                n //= p
        if n != 1:
            dct[n] += 1
        dct = dict(dct)
        return dct

n = int(input())
pf = prime_factorization(n)

Z = []
for k, v in pf.items():
    for i in range(1, v + 1):
        Z.append(k ** i)
Z.sort()
count = 0
for z in Z:
    if n % z == 0:
        count += 1
        n //= z


print(count)

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

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

a = factorization(n)
c = 0
for i in a:
	k = 1
	x = i[1]
	while x-k >= 0:
		x -= k
		c += 1
		k += 1
if n == 1:
	print (0)
else:
	print (c)

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 = 0

fact = factorization(n)

for p, e in fact:
    f = e
    j = 1
    while f >= 0:
        f -= j
        j += 1
    ans += j - 2
    
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())

ans = 0

c = collections.Counter(prime_factorize(n))

for key in c.keys():
    for i in range(1, c[key] + 1):
        if n % (key ** i) == 0:
            n //= (key ** i)
            ans += 1


print(ans)

Solution (Python):
import math
def get_prime(n):
    if n <= 1:
        return []
    prime = [2]
    if n > 2:
        limit = int(math.sqrt(n))
        odd = [i for i in range(3, n + 1, 2)]
        while limit >= odd[0]:
            prime.append(odd[0])
            odd = [j for j in odd if j % odd[0] != 0]
        prime += odd
    return prime

from collections import defaultdict
def prime_factorization(n):
    if n <= 1:
        return {}
    else:
        
        prime = get_prime(int(math.sqrt(n)))
        dct = defaultdict(int)
        for p in prime:
            while n % p == 0:
                dct[p] += 1
                n //= p
        if n != 1:
            dct[n] += 1
        dct = dict(dct)
        return dct

n = int(input())
pf = prime_factorization(n)

Z = []
for k, v in pf.items():
    for i in range(1, v + 1):
        Z.append(k ** i)
Z.sort()
count = 0
for z in Z:
    if n % z == 0:
        count += 1
        n //= z
    if n == 1:
        break

print(count)

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

def factorize(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(readline())
    fct = factorize(N)
    res = 0
    for a, b in fct:
        p = 1
        while b - p >= 0:
            b -= p
            res += 1
            p += 1

    print(res)
    
if __name__ == '__main__':
    main()

Solution (Python):
import math

N = int(input())

p = 2
counter = 0
while N != 1:
 if p > math.sqrt(N):
  counter += 1
  break
 ind = 0
 n = -1
 while N % p == 0:
  N //= p
  ind += 1
 if ind == 0:
  p += 1
  continue
 while (n+1)*(n+2)//2 <= ind:
  n += 1
 counter += n
 p += 1

print(counter)

Solution (Python):
def CountTimesforT(N, T):
    t = T
    count = 0
    while N % t == 0:
        count += 1
        N //= t
        t *= T
    while N % T == 0:
        N //= T
    return [count, N]

N = int(input())
M = int(pow(N, 0.5)) + 2
ans = 0
if N != 1:
    for i in range(2, M):
        if N % i == 0:
            l = CountTimesforT(N, i)
            N = l[1]
            ans += l[0]
    if N != 1:
        ans += 1
print(ans)

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



from heapq import *

def linput(_t=int):
	return list(map(_t, input().split()))

def gcd(n,m):
    while m: n,m = m, n%m
    return n

def lcm(n,m): return n*m//gcd(n,m)

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

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

	res = 0
	vQ = prime_factorize(N)
	vQ.sort(reverse=True)
	
	sV = set([])
	t = 1
	pp = 1
	for p in vQ:
		if t != 1 and p != pp:
			t = 1
		t *= p
		if t not in sV:
			N //= t
			sV |= {t}
			res += 1
			t = 1
		pp = p
		if N==1: break
	
	print(res)
	


main()

Solution (Python):
import sys
from collections import Counter

sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline


def prime_factorization(n):
    prime_arr = []
    while n % 2 == 0:
        prime_arr.append(2)
        n //= 2

    f = 3
    while f * f <= n:
        if n % f == 0:
            prime_arr.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        prime_arr.append(n)
    return prime_arr


N = int(input())
c = Counter(prime_factorization(N))
counter = 0

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

print(counter)

Solution (Python):
import sys
from collections import Counter

sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline


def prime_factorization(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_factorization(N))
counter = 0

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

print(counter)

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

fg=[]
for i in range(1,16):
    fg.append(i*(i+1)//2)

tmp=[]
for i in range(len(t)):
    cnt=0
    for j in range(len(fg)):
        if t[i][1]>=fg[j]:
            cnt=(j+1)
    ans+=cnt

print(ans)

Solution (Python):
import math


def prime_factorization(N):

    n = N
    sqrt = int(math.sqrt(n)) + 1
    m = {}
    for i in range(2, sqrt):
        if n % i == 0:
            cnt = 0
            while n % i == 0:
                cnt += 1
                n /= i
            m[i] = cnt

    
    if n != 1:
        m[n] = 1

    return m

n = int(input())
m = prime_factorization(n)
ans = 0

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

print(ans)

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
mod2 = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


class Prime():
    def __init__(self, n):
        self.M = m = int(math.sqrt(n)) + 10
        self.A = a = [True] * m
        a[0] = a[1] = False
        self.T = t = [2]
        for j in range(4, m, 2):
            a[j] = False
        for i in range(3, m, 2):
            if not a[i]:
                continue
            t.append(i)
            for j in range(i*i,m,i):
                a[j] = False
        self.ds_memo = {}
        self.ds_memo[1] = set([1])

    def is_prime(self, n):
        return self.A[n]

    def division(self, n):
        d = collections.defaultdict(int)
        for c in self.T:
            while n % c == 0:
                d[c] += 1
                n //= c
            if n < 2:
                break
        if n > 1:
            d[n] += 1
        return d

    
    def divisions(self, n):
        if n in self.ds_memo:
            return self.ds_memo[n]

        for c in self.T:
            if n % c == 0:
                rs = set([c])
                for cc in self.divisions(n // c):
                    rs.add(cc)
                    rs.add(cc * c)
                self.ds_memo[n] = rs
                return rs

        rs = set([1, n])
        self.ds_memo[n] = rs
        return rs

    def sowa(self, n):
        r = 1
        for k,v in self.division(n):
            t = 1
            for i in range(1,v+1):
                t += math.pow(k, i)
            r *= t
        return r


def main():
    n = I()
    pr = Prime(n)
    d = pr.division(n)
    r = 0
    for c in d.values():
        for i in range(1,1000):
            if c < i:
                break
            r += 1
            c -= i

    return r

print(main())

Solution (Python):


import math
N = int(input())
PrimeFactList = []
tmpNum = N



for i in range(2, int(math.sqrt(N))+1):
    if N % i == 0:
        expcnt = 0
        while tmpNum % i == 0:
            tmpNum //= i
            expcnt += 1
        PrimeFactList.append(i)
        PrimeFactList.append(expcnt)


if tmpNum != 1:
    PrimeFactList.append(tmpNum)
    PrimeFactList.append(1)


if len(PrimeFactList) == 0:
    PrimeFactList.append(N)
    PrimeFactList.append(1)
ans = 0

if PrimeFactList[0] == 1:
    print(0)
    exit()

opeList = [1, 3, 6, 10, 15, 21, 28, 36, 45]  
for i in range(1, len(PrimeFactList), 2):
    for j in range(len(opeList)):
        if PrimeFactList[i] < opeList[j]:
            ans += j
            break
print(ans)

Solution (Python):
from math import sqrt
from bisect import bisect


def main():
    N = int(input())
    factor = {}
    max_count = 1
    while N > 1:
        for i in range(2, int(sqrt(N)) + 1):
            if N % i == 0:
                N = N // i
                if i in factor:
                    factor[i] += 1
                    if max_count < factor[i]:
                        max_count = factor[i]
                else:
                    factor[i] = 1
                break
        else:
            if N in factor:
                factor[N] += 1
                if max_count < factor[N]:
                    max_count = factor[N]
            else:
                factor[N] = 1
            N = 1
    sum_up = [n * (n + 1) // 2 for n in range(max_count + 1)]
    ans = 0
    for prime, count in factor.items():
        ans += bisect(sum_up, count)-1
    print(ans)


if __name__ == "__main__":
    main()

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

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

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

    return arr

for i, j in factorization(N):
    if i == 1:
        print("0")
        sys.exit()
    n= 1
    while 2*j >= n*(n+1):
        n += 1
        ans += 1
    
print(ans)

Solution (Python):


def factorization(n):
    arr = []
    tmp = n
    i = 2
    while i ** 2 <= n:
        if tmp % i == 0:
            cnt = 0
            while tmp % i == 0:
                tmp //= i
                cnt += 1
            arr.append([i, cnt])
        i += 1
    if tmp != 1:
        arr.append([i, 1])
    if arr == []:
        arr.append([n, 1])
    return arr

def main():
    n = int(input())
    if n == 1:
        print(0)
        exit()

    f = factorization(n)
    ans = 0
    c = len(f)
    for i in range(c):
        s = 0
        g = f[i][1]
        if g <= 2:
            ans += 1
        else:
            for j in range(g):
                f[i][1] -= j+1
                s += j+1
                if s > g:
                    break
                ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
def prime_factorize(n):
    result = []
    if n % 2 == 0:
        t = 0
        while n % 2 == 0:
            n //= 2
            t += 1
        result.append((2, t))
    for i in range(3, int(n ** 0.5) + 1, 2):
        if n % i != 0:
            continue
        t = 0
        while n % i == 0:
            n //= i
            t += 1
        result.append((i, t))
        if n == 1:
            break
    if n != 1:
        result.append((n, 1))
    return result


N = int(input())

result = 0
for p, e in prime_factorize(N):
    i = 1
    while e >= i:
        result += 1
        e -= i
        i += 1
print(result)

Solution (Python):
from math import sqrt


def prime_factorize(n):
    result = []
    if n % 2 == 0:
        t = 0
        while n % 2 == 0:
            n //= 2
            t += 1
        result.append((2, t))
    for i in range(3, int(sqrt(n)) + 1, 2):
        if n % i != 0:
            continue
        t = 0
        while n % i == 0:
            n //= i
            t += 1
        result.append((i, t))
        if n == 1:
            break
    if n != 1:
        result.append((n, 1))
    return result


N = int(input())

result = 0
for p, e in prime_factorize(N):
    i = 1
    while e >= i:
        result += 1
        e -= i
        i += 1
print(result)

Solution (Python):
from math import sqrt


def prime_factorize(n):
    result = []
    for i in range(2, int(sqrt(n)) + 1):
        if n % i != 0:
            continue
        t = 0
        while n % i == 0:
            n //= i
            t += 1
        result.append((i, t))
        if n == 1:
            break
    if n != 1:
        result.append((n, 1))
    return result


N = int(input())

result = 0
for p, e in prime_factorize(N):
    i = 1
    while e >= i:
        result += 1
        e -= i
        i += 1
print(result)

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

n = int(input())
from collections import Counter 
b = Counter(pf(n))

ans = 0
for i in b:
    a = b[i]
    for i in range(1,30):
        a -= i
        if a < 0:
            break
        ans += 1
        
print(ans)

Solution (Python):

from collections import deque
import math


def read(): return input()
def read_int(): return int(input())
def read_array(type=int): return list(map(type, input().split()))
def read_tupple(type=None):
    tmp = input().split()
    if type is None: return map(int, tmp)
    assert len(tmp) == len(type)
    return [type[i](tmp[i]) for i in range(len(tmp))]


class PrimeNumber:
    def __init__(self, N):
        self.N = N
        self.ok, self.F, self.P = self.compute(N)

    def compute(self, N):
        isP, F, P = [True] * (N + 1), [-1] * (N + 1), []
        for i in range(2, N+1):
            if isP[i]:
                F[i] = i
                P.append(i)
                for j in range(2*i, N+1, i):
                    isP[j] = False
                    F[j] = i
        return isP, F, P

    def factorization(self, x):
        ret, MAX_P = [], int(math.sqrt(x))
        for p in self.P:
            if p > MAX_P: break
            cnt = 0
            while x % p == 0:
                x /= p
                cnt += 1
            ret.append((x, cnt))
        if x > 1: ret.append((x, 1))
        return ret

N = read_int()

pn = PrimeNumber(1000006)
ans = 0
for p, cnt in pn.factorization(N):
    dec = 1
    while cnt >= dec:
        cnt -= dec
        dec += 1
        ans += 1
print(ans)

Solution (Python):
import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))



N = I()

def trial_division(n):
    d = defaultdict(int)
    while n%2 == 0:
        d[2] += 1
        n = n//2
    p = 3
    while p**2 <= n:
        while n%p == 0:
            d[p] += 1
            n = n//p
        p += 2
    if n != 1:
        d[n] += 1
    return d


d = trial_division(N)
ans = 0
for k in d.keys():
    ok = 0
    ng = 2*d[k]
    while abs(ok-ng) > 1:
        mid = (ok+ng)//2
        if mid*(mid+1) <= 2*d[k]:
            ok = mid
        else:
            ng = mid
    ans += ok

print(ans)

Solution (Python):

from collections import deque
import math


def read(): return input()
def read_int(): return int(input())
def read_array(type=int): return list(map(type, input().split()))
def read_tupple(type=None):
    tmp = input().split()
    if type is None: return map(int, tmp)
    assert len(tmp) == len(type)
    return [type[i](tmp[i]) for i in range(len(tmp))]


class PrimeNumber:
    def __init__(self, N):
        self.N = N
        self.isP, self.P = self.compute(N)

    def compute(self, N):
        isP, P = [True] * (N + 1), []
        for i in range(2, N+1):
            if isP[i]:
                P.append(i)
                for j in range(2*i, N+1, i):
                    isP[j] = False
        return isP, P

    def factorization(self, x):
        ret, MAX_P = [], math.sqrt(x)
        for p in self.P:
            if p > MAX_P:
                break
            cnt = 0
            while x % p == 0:
                x /= p
                cnt += 1
            ret.append((x, cnt))
        if x > 1:
            ret.append((x, 1))
        return ret

N = read_int()

pn = PrimeNumber(1000006)
ans = 0
for p, cnt in pn.factorization(N):
    dec = 1
    while cnt >= dec:
        cnt -= dec
        dec += 1
        ans += 1
print(ans)

Solution (Python):

from collections import deque


def read(): return input()
def read_int(): return int(input())
def read_array(type=int): return list(map(type, input().split()))
def read_tupple(type=None):
    tmp = input().split()
    if type is None: return map(int, tmp)
    assert len(tmp) == len(type)
    return [type[i](tmp[i]) for i in range(len(tmp))]


class PrimeNumber:
    def __init__(self, N):
        self.N = N
        self.isP, self.P = self.compute(N)

    def compute(self, N):
        isP, P = [True] * (N + 1), []
        for i in range(2, N+1):
            if isP[i]:
                P.append(i)
                for j in range(2*i, N+1, i):
                    isP[j] = False
        return isP, P

    def factorization(self, x):
        ret = []
        for p in self.P:
            cnt = 0
            while x % p == 0:
                x /= p
                cnt += 1
            ret.append((x, cnt))
        if x > 1:
            ret.append((x, 1))
        return ret

N = read_int()

pn = PrimeNumber(1000006)
ans = 0
for p, cnt in pn.factorization(N):
    dec = 1
    while cnt >= dec:
        cnt -= dec
        dec += 1
        ans += 1
print(ans)

Solution (Python):

from collections import deque


def read(): return input()
def read_int(): return int(input())
def read_array(type=int): return list(map(type, input().split()))
def read_tupple(type=None):
    tmp = input().split()
    if type is None: return map(int, tmp)
    assert len(tmp) == len(type)
    return [type[i](tmp[i]) for i in range(len(tmp))]


class PrimeNumber:
    def __init__(self, N):
        self.N = N
        self.isP, self.P = self.compute(N)

    def compute(self, N):
        isP, P = [True] * (N + 1), []
        for i in range(2, N+1):
            if isP[i]:
                P.append(i)
                for j in range(2*i, N+1, i):
                    isP[j] = False
        return isP, P

N = read_int()

pn = PrimeNumber(1000006)
ans = 0
for p in pn.P:
    cnt = 0
    while N % p == 0:
        N /= p
        cnt += 1
    dec = 1
    while cnt >= dec:
        cnt -= dec
        dec += 1
        ans += 1
if N > 1:
    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() )
fact = factorization( n )
cnt = 0
for f in fact:
  if f[0] == 1:
    continue
  i = 1
  while True:
    f[1] -= i
    i += 1
    if f[1] < 0:
      break
    cnt += 1
print( cnt )

Solution (Python):
n=int(input())
a=0
b=1
c=0
d=n**0.5+1
d=int(d)
for i in range(2,d):
  while(n%i==0):
    a+=1
    n/=i
  while(1):
    if a>=b:
      c+=1
      a-=b
      b+=1
    else: break
  a=0
  b=1
if n>1: c+=1
print(c)

Solution (Python):

from collections import deque


def read(): return input()
def read_int(): return int(input())
def read_array(type=int): return list(map(type, input().split()))
def read_tupple(type=None):
    tmp = input().split()
    if type is None: return map(int, tmp)
    assert len(tmp) == len(type)
    return [type[i](tmp[i]) for i in range(len(tmp))]


class PrimeNumber:
    def __init__(self, N):
        self.N = N
        self.compute()

    def compute(self):
        self.isP, self.P = [True] * (self.N + 1), []
        for i in range(2, self.N+1):
            if self.isP[i]:
                self.P.append(i)
                for j in range(2*i, self.N+1, i):
                    self.isP[j] = False

N = read_int()

pn = PrimeNumber(1000006)
ans = 0
for p in pn.P:
    cnt = 0
    while N % p == 0:
        N /= p
        cnt += 1
    dec = 1
    while cnt >= dec:
        cnt -= dec
        dec += 1
        ans += 1
if N > 1:
    ans += 1
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

res = 0
for _, x in factorization(N):
    i = 1
    while i <= x:
        res += 1
        x -= i
        i += 1
if N == 1:
    print(0)
else:
    print(res)

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

z=[]

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)

count=0
for i in f:
  if i[0]==1:
    pass
  else:
    a=i[1]
    c=1
    while True:
      if a>=c:
        a-=c
        count+=1
        c+=1
      else:
        break
      
print(count)

Solution (Python):

from collections import deque


def read(): return input()
def read_int(): return int(input())
def read_array(type=int): return list(map(type, input().split()))
def read_tupple(type=None):
    tmp = input().split()
    if type is None: return map(int, tmp)
    assert len(tmp) == len(type)
    return [type[i](tmp[i]) for i in range(len(tmp))]


N = read_int()

MAX_P = 1000006
isP = [True] * MAX_P
for i in range(2,MAX_P):
    if isP[i]:
        for j in range(2*i,MAX_P,i):
            isP[j] = False

P = [i for i in range(2,MAX_P) if isP[i]]
ans = 0
for p in P:
    cnt = 0
    while N % p == 0:
        N /= p
        cnt += 1
    dec = 1
    while cnt >= dec:
        cnt -= dec
        dec += 1
        ans += 1
if N > 1:
    ans += 1
print(ans)

Solution (Python):
def p_facto(n):
    ret = []
    nc = n
    for i in range(2, nc):
        if i*i > nc:
            break
        if n % i == 0:
            ex = 0
            while n % i == 0:
                ex += 1
                n //= i
            ret.append([i, ex])
    if n != 1:
        ret.append([n, 1])
    return ret


def main(N):
    ans = 0
    for p, e in pf:
        ex = 1
        while e >= ex:
            z = p**ex
            if N % z == 0:
                ans += 1
                N //= z
            else:
                break
            e -= ex
            ex += 1
    print(ans)


if __name__ == "__main__":
    N = int(input())
    pf = p_facto(N)
    main(N)

Solution (Python):
import math
from collections import Counter



def prime_factorization(num):
    """
    素因数分解
    ;param num 素因数分解したい数字
    ;return result {素因数: 回数, ・・・}
    """

    result = dict()

    N = num

    x = 2
    while x <= int(math.sqrt(num)) + 1:
        if (num % x) == 0:
            count = 0
            while (num % x) == 0:
                count += 1
                num = num / x

            result[x] = count

        x += 1

    if num != 1:
        result[num] = 1

    if result == []:
        result[N] = 1

    return result


N = int(input())


result = prime_factorization(N)


ans = 0
for value in result.values():
    c = 1
    while (value - c) >= 0:
        ans += 1
        value -= c
        c += 1

print(ans)

Solution (Python):
from sys import stdin



def prime_factorization_tuple(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 get_result(data):
    N = data[0]
    fct = prime_factorization_tuple(N)
    ans = 0
    for (_, exp) in fct:
        cnt = 0
        for i in range(1, 11):
            exp -= i
            if exp >= 0:
                cnt += 1
        ans += cnt
    return ans


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip().split(' ')))
    result = get_result(data)
    print(result)

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

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

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

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

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

    return seq

so = factorization(n)

ans = 0
for i in range(len(so)):
    j = 1
    mun = so[i][1]
    while mun >= j:
        if mun - j >= 0:
            ans += 1
            mun -= j
            j += 1

print(ans)

Solution (Python):
def factorization(N):
    factoring={}
    num=N
    for i in range(2,int(N**.5)+1):
        if num%i==0:
            count=0
            while num%i==0:
                count+=1
                num//=i
            factoring[i]=count
    if num!=1:
        factoring[num]=1
    return factoring

N=int(input())
prime=factorization(N)
count=0
for num in prime:
    e=1
    while prime[num]>=e:
        count+=1
        prime[num]-=e
        e+=1
print(count)

Solution (Python):
import collections

n = int(input())


N = 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)

c = collections.Counter(a)

sosu_list = list(c.keys())

kosu_list = list(c.values())

count = 0

for index, num in enumerate(sosu_list):
    kosu = kosu_list[index]
    p = num
    e = 1
    while True:
        if kosu - e > e:
            z = p ** e
            kosu = kosu - e
            e = e + 1
            N = N / z
            count = count + 1
        else:
            count = count + 1
            break
print(count)