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

Solution (Python):
import math
N = int(input())
t = 0
p = N
tmp = int(math.sqrt(N)) + 1
for num in range(2,tmp):
    d = 1
    while N % num**d ==0:
        N //= num**d
        t += 1
        d += 1
    if(N % num == 0):
        while N % num == 0:
            N //= num
if (N != 1):
    t+=1
if(t==0 and p != 1):
    t = 1
print(t)

Solution (Python):

import sys

from functools import reduce

import math


from collections import defaultdict
from math import sqrt

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

def prime_factors(n):
    primes = defaultdict(int)
    i = 2
    mx = sqrt(n)
    while n != 1:
        if n % i == 0:
            n = n // i
            primes[i] += 1
        elif i >= mx:
            if len(primes) == 0:
                primes[i] += 1
            elif is_prime(n):
                primes[i] += 1
            break
        else:
            i += 1
    return primes

def solve_n(x):
    return (-1 + sqrt(1 + 4 * 2* x)) / 2

def solve(N: int):
    fs = prime_factors(N)
    count = 0
    for key, value in fs.items():
        val = solve_n(value)
        count += math.floor(val)

    print(count)
    return




def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)


if __name__ == "__main__":
    main()

Solution (Python):

import sys

from functools import reduce

import math


from collections import defaultdict
from math import sqrt

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

def prime_factors(n):
    primes = defaultdict(int)
    i = 2
    mx = sqrt(n)
    while n != 1:
        if n % i == 0:
            n = n // i
            primes[i] += 1
        elif i >= mx:
            if len(primes) == 0:
                primes[i] += 1
            elif is_prime(n):
                primes[i] += 1
            break
        else:
            i += 1
    return primes

def solve_n(x):
    return (-1 + sqrt(1 + 4 * 2* x)) / 2

def solve(N: int):
    fs = prime_factors(N)
    count = 0
    for key, value in fs.items():
        val = solve_n(value)
        count += math.floor(val)

    print(count)
    return




def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)


if __name__ == "__main__":
    main()

Solution (Python):
import decimal
import math

N = int(input())
i = 2
counter = {}
while i * i < N:
  cnt = 0
  while N % i == 0:
    cnt += 1
    N //= i
  counter[i] = cnt
  i += 1

if N != 1:
  counter.setdefault(N, 0)
  counter[N] += 1


ans = 0

for i, v in counter.items():
  p = 1
  while True:
    if v - p >= 0:
      
      v -= p
      ans += 1
      p += 1
    else:
      break

print (ans)

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


def solve(n):
    res = 0
    for d in range(2, n):
        if d * d > n:
            break

        degree = 0
        while n % d == 0:
            n /= d
            degree += 1

        i = 1
        while degree >= i:
            degree -= i
            i += 1
            res += 1

    if n > 1:
        res += 1
    return res


print(solve(n))

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:
    result = 0
    for i in range(len(factorization(N))):
        tempnumber = factorization(N)[i][1]
        plusnumber = 1
        while tempnumber > 0:
            result += 1
            plusnumber += 1
            tempnumber -= plusnumber
    print(result)

Solution (Python):
n=int(input())
a=p=1
while p<1e6:
 c=t=0;p+=1
 while n%p<1:n/=p;x=c==t;t+=x;c+=1-t*x;a+=x
print(a-(n<2))

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())
fac = factorization(N)
cnt = 0

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

for i in range(len(fac)):
    e = 1
    while fac[i][1]-e >= 0:
        fac[i][1] -= e
        e += 1
        cnt += 1 
print(cnt)

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



def factorize(x):
      res = []
      for i in range(2, int(x**0.5)+1):
          if x%i != 0:
              continue
          cnt = 0
          while x%i == 0:
              x //= i
              cnt += 1 
          res.append((i, cnt))
      if x != 1:
          res.append((x, 1))
      return res
 
def f(x):
    l = 0     
    r = 1000
    while r-l>1:
        c = (r+l)//2
        if x >= c*(c+1)//2:
            l = c
        else:
            r = c
    return l 
def main():
    n = int(readline())    
    fact = factorize(n)     
    ans = 0
    for i, j in fact:
        ans += f(j)
    print(ans)
if __name__ == '__main__':
    main()

Solution (Python):
def factorize(n):
    """
    素因数はたかだか n**0.5 以下
    :return: e.g. factorize(24) -> {2: 3, 3: 1} (24 = 2**3 * 3**1)
    """
    res = {}
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            res[i] = 0
            while temp % i ==0:
                res[i] += 1
                temp //= i

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

    if len(res) == 0:
        res[n] = 1

    return res

def factorize_exp(n):
    """
    Return only exponents of factorization.
    :return: e.g. factorize(24) -> [3, 1] (24 = 2**3 * 3**1)
    """
    res = []
    temp = n

    if n == 1:
        
        return res

    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
            res.append(cnt)
    if temp != 1:
        res.append(1)

    if len(res) == 0:
        res.append(1)

    return res


n = int(input())
factors = factorize_exp(n)
cnt = 0

for i in factors:
    rem = i
    j = 1
    while rem >= j:
        rem -= j
        cnt += 1
        j += 1

print(cnt)

Solution (Python):


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

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

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

    return arr

n = int(input())
if n == 1:
    print(0)
else:
    x_list = factorization(n)
    ans = 0
    for x in x_list:
        n = 2
        while True:
            if x[1] < (n * n + n) // 2:
                ans += n - 1
                break 
            n += 1

    print(ans)

Solution (Python):


import sys
from math import sqrt
input = sys.stdin.readline

def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    s = input()
    return(list(s[:len(s) - 1]))
def invr():
    return(map(int,input().split()))

n = inp()

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

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

fact = factoriation(n)
res = 0
if n==1:
    print(0)
    exit()
for i in range(len(fact)):
    for j in range(1,fact[i][1]+1):
        if n%(fact[i][0]**j) == 0:
            res+=1
            n = n/(fact[i][0]**j)
print(res)

Solution (Python):
def prime(n):
    p = dict([])
    i = 2
    while i*i <= n:
        while n % i == 0:
            n /= i
            if i in p:
                p[i] += 1
            else:
                p[i] = 1
        i += 1
    if n > 1:
        p[int(n)] = 1
    return p


n = int(input())

import math
ans = 0
for a in prime(n).values():
    ans += math.floor(math.sqrt(8*a+1) - 1)//2

print(ans)

Solution (Python):
from collections import Counter
def primeFactorize(n):
    fac = []
    if n < 2: return fac
    while n%2 == 0:
        n //= 2
        fac.append(2)
    for i in range(3,int(n**0.5)+1,2):
        while n%i == 0:
            n //= i
            fac.append(i)
    if n != 1: fac.append(n)
    return fac

n = int(input())
ans = 0
cnt = Counter(primeFactorize(n))
for v in cnt.values():
    c = 1
    while c <= v:
        ans += 1
        v -= c
        c += 1
print(ans)

Solution (Python):

n = int(input())

import math


def first_div(n):
    for i in range(3, math.ceil(math.sqrt(n)) + 1, 2):
        if n % i == 0:
            return i
    return n

def next_div(start, stop):
    for i in range(start, math.ceil(math.sqrt(n)) + 1, 2):
        if n % i == 0:
            return i
    return n   

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


ans = 0
currentBase = 2
while n > 1:
    if n % currentBase == 0:
        currentDiv = currentBase
        while True:
            ans += 1
            n = n//currentDiv
            currentDiv = currentDiv * currentBase
            if n%currentDiv != 0 or n <= 1:
                while n%currentBase == 0:
                    n = n//currentBase
                break
    if currentBase == 2:
        currentBase = 3
    else:
        currentBase = next_div(currentBase+2, n)


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

for i in c:
  k = 0
  j = 1
  while k <= c[i]:
    k += j
    j += 1
  rlt += (j-2)
  
print(rlt)

Solution (Python):
from collections import defaultdict

n = int(input())

num = 2
d = defaultdict(int)
while num * num <= n:
    while n % num == 0:
        n //= num
        d[num] += 1

    num += 1

if n != 1:
    d[n] += 1

ans = 0
for v in d.values():
    mn = 1
    while v >= mn:
        v -= mn
        ans += 1
        mn += 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
fact = factorization(n)
cnt = 0

for i in range(len(fact)):
    for j in range(1,fact[i][1]+1):
        if n==1:
            print(cnt)
            exit()
        if n%(fact[i][0]**j)==0:
            cnt += 1
            n = n/(fact[i][0]**j)
print(cnt)

Solution (Python):
N = int(input())
primetable = []

i = 2
while i* i <= N:
  if(N % i == 0):
    j = 0
    while N % i == 0:
      N/= i
      j+= 1
    primetable.append((i, j))
  i+= 1
if(N != 1):
  primetable.append((int(N), 1))
  
Ans = 0  
for i in primetable:
  ans = 0
  n = 1
  while 1/ 2* n* (n+ 1)<= i[1]:
    ans = n
    n+= 1
  Ans+= ans  
  
print(Ans)

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

cnt = 0
result = 0

num = [1,3,6,10,15,21,28,36,45,55,66]

def prime_factorize(n):
    """[summary]
    素因数分解の関数、整数を入力して配列を返す
    計算量はO(√N)
    Arguments:
        n {[int]} -- 素進数分解するための整数

    Returns:
        list -- 素因数分解した後の数字の配列
    """    
    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 factorization(n):
    """[summary]
    素因数分解して、素数の種類とその素数の個数を二次元配列に入れる
    Arguments:
        n {int} -- 素因数分解する整数

    Returns:
        [arr] -- [[素数, 個数], [素数, 個数], ... ]
    """    
    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)

if N == 1:
    print(0)
else:
    for p,e in L:
        cnt = 1
        for i in range(2,100):
            cnt += i
            if e < cnt:
                result += i-1
                break
                
    print(result)

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())
l = prime_factorize(N)
m = collections.Counter([])
m[1]=1
x=1
cnt=0
y=list()
for i in range(len(l)):
    if x!=1 and x%l[i]!=0:
        x=1
    x*=l[i]
    
    if m[x]==0:
        y.append(x)
        m[x]=1
        cnt+=1
        x=1



print(cnt)

Solution (Python):
from math import sqrt
from collections import defaultdict

n = int(input())

d = defaultdict(int)
for i in range(2, int(sqrt(n)) + 10):
    while n % i == 0:
        d[i] += 1
        n //= i

if n != 1:
    d[n] += 1

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

print(ans)

Solution (Python):
N = int(input())
pf = {}
answer = 0

for i in range(2,int(N**0.5)+1):
    while N % i ==0:
        pf[i] = pf.get(i, 0) + 1
        N //= i
    
    if N < i:
        break
if N > 1:
    answer += 1
    
for j, k in pf.items():
    sq = 1
    for l in range(k):
        answer += 1
        k -= sq
        sq += 1
        if k == 0:
            break
        elif k < 0:
            answer -= 1
            break

print(answer)

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


bunkai = factorization(N)
count = 0

prime_flag = False
for x in bunkai:
    if x[0] == 1:
        prime_flag = True
        break
    else:
        check = x[1]
        current = 2
        while True:
            check -= current
            if check > 0:
                current += 1
            else:
                break
        count += current - 1
if prime_flag:
    print(0)
else:
    print(count)

Solution (Python):
def main():
    N = int(input())
    A = []
    x = N
    l = int(N ** 0.5)
    for t in range(2, l + 1):
        while x % t == 0:
            A.append(t)
            x //= t

    if x > 1:
        A.append(x)

    import collections
    ans = 0
    for v in collections.Counter(A).values():
        for n in range(1, 41):
            if v < n * (n + 1) // 2:
                ans += n - 1
                break

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
import math
from collections import defaultdict

def main2():
    N = int(input())
    fac = defaultdict(int)
    lim = int(math.sqrt(N))

    for i in range(2, lim + 1):
        while N % i == 0:
            is_p = False
            fac[i] += 1
            N = N // i

        if i == lim:
            if N != 1:
                fac[N] += 1

    ans = 0
    for k, v in fac.items():
        e = 1
        for i in range(10000000):       
            if e <= v:
                ans += 1
                v -= e
                e += 1
            else:
                break
    print(ans)

if __name__ == "__main__":
    main2()

Solution (Python):
from collections import Counter
import math

def div(n):
    prime = []
    tmp = int(math.sqrt(n)) + 1
    
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            prime.append(num)
    
    if n != 1:
        prime.append(n)
    return prime

n = int(input())
prime_div = Counter(div(n))
ans = 0

for p, ex in prime_div.items():
    k = 1
    while ex >= k:
        ex -= k
        ans += 1
        k += 1

print(ans)

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

for i, j in pf.items():
  temp = j
  for k in range(1, j+1):
    temp   -= k
    if temp < 0:
      break
    else:
      answer += 1
      
print(answer)

Solution (Python):
from math import sqrt
n=int(input())
rn=int(sqrt(n))
s=[0]*(rn+1)
s[0]=-1
s[1]=-1
t=[0]*(rn+1)
for i in range(2,rn+1):
    if s[i] != 0:
        continue
    s[i] = i
    j = i
    while j < rn + 1:
        t[j] = 1
        j *= i
    for j in range(i * i, rn + 1,i):
        if s[j] == 0:
            s[j] = i

result = 0
last = -1
for i in range(2,rn+1):
    if t[i] == 0:
        continue
    if n % i == 0:
        result += 1
        n //= i
        last =i
if n != 1 and n > rn:
    result += 1
print(result)

Solution (Python):
import math
from collections import defaultdict

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

    for i in range(2, int(math.sqrt(N))+1):
        while N % i == 0:
            is_p = False
            fac[i] += 1
            N = N // i

    if N != 1:
        fac[N] += 1

    ans = 0
    for k, v in fac.items():
        e = 1
        for i in range(10000000):       
            if e <= v:
                ans += 1
                v -= e
                e += 1
            else:
                break
    print(ans)

if __name__ == "__main__":
    main()

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

n = int(input())
factors = factorization(n)
res = 0
for j,cnt in factors:
  if j == 1: continue
  i = 1
  while cnt >= i:
    cnt -= i
    i += 1
    res += 1

print(res)

Solution (Python):
import collections as ct

n = int(input())

def calc(x):
    num = 1
    ref = 0

    while num <= x:
        x -= num
        ref += 1
        num += 1
    
    return ref

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 = ct.Counter(prime_factorize(n))
d = list(c.values())
ans = list(map(calc,d))

print(sum(ans))

Solution (Python):
def f(exponent):
	
	lo,hi = 1, exponent + 1
	while(lo < hi):
		med = (lo + hi)/2
		if med * (med + 1)/2 > exponent:
			hi = med
		else:
			lo = med +1
	return lo -1

def answer(n):
	if n == 1: return 0
	res = 0
	for d in range(2, int(n ** 0.5) + 2):
		if n % d == 0:
			e = 0
			while(n%d == 0): 
				e +=1
				n/=d
			res+= f(e)
	if n > 1: res += 1
	return res

print answer(int(raw_input()))

Solution (Python):
def f(exponent):
	
	step = 1
	cumul = 0
	count = 0
	while( cumul <= exponent):
		cumul += step
		count +=1
		step +=1
	return count - (1 if cumul > exponent else 0)

def answer(n):
	if n == 1: return 0
	res = 0
	for d in range(2, int(n ** 0.5) + 2):
		if n % d == 0:
			e = 0
			while(n%d == 0): 
				e +=1
				n/=d
			res+= f(e)
	if n > 1: res += 1
	return res

print answer(int(raw_input()))

Solution (Python):
def f(exponent):
	
	step = 1
	cumul = 0
	count = 0
	while( cumul <= exponent):
		cumul += step
		count +=1
		step +=1
	return count - (1 if cumul > exponent else 0)

def answer(n):
	if n == 1: return 0
	res = 0
	on = n
	p = True
	for d in range(2, int(on ** 0.5) + 2):
		if n % d == 0:
			p = False
			e = 0
			while(n%d == 0): 
				e +=1
				n/=d
			res+= f(e)
	if n > 1: res += 1
	return res

print answer(int(raw_input()))

Solution (Python):
from math import sqrt

N = int(input())

rn = int(sqrt(N))
sieve = [0] * (rn + 1)
sieve[0] = -1
sieve[1] = -1
t = [0] * (rn + 1)
for i in range(2, rn + 1):
    if sieve[i] != 0:
        continue
    sieve[i] = i
    j = i
    while j < rn + 1:
        t[j] = 1
        j *= i
    for j in range(i * i, rn + 1, i):
        if sieve[j] == 0:
            sieve[j] = i

result = 0
last = -1
for i in range(2, rn + 1):
    if t[i] == 0:
        continue
    if N % i == 0:
        result += 1
        N //= i
        last = i
if N != 1 and N > rn:
    result += 1
print(result)

Solution (Python):
def sieve(x):
    """
    Sieve of Eratosthenes
    :param x: max value
    :return: list of bool
    """

    is_prime = [True] * (x + 1)
    is_prime[0] = is_prime[1] = False

    for i in range(2, x + 1):
        if is_prime[i]:
            for j in range(i * 2, x + 1, i):
                is_prime[j] = False

    return is_prime


n = int(input())

is_prime = sieve(10 ** 6)
primes = [i for i, e in enumerate(is_prime) if e]

ans = 0
for e in primes:
    div = e
    while n % div == 0:
        n //= div
        ans += 1
        div *= e

    while n % e == 0:
        n //= e

ans += n != 1

print(ans)

Solution (Python):
def sieve(x):
    """
    Sieve of Eratosthenes
    :param x: max value
    :return: list of bool
    """

    is_prime = [True] * (x + 1)
    is_prime[0] = is_prime[1] = False

    for i in range(2, x + 1):
        if is_prime[i]:
            for j in range(i * 2, x + 1, i):
                is_prime[j] = False

    return is_prime


n = int(input())

is_prime = sieve(10 ** 6)
primes = [i for i, e in enumerate(is_prime) if e]

ans = 0
for e in primes:
    div = e
    while n % div == 0:
        n //= div
        ans += 1
        div *= e

    while n % e == 0:
        n //= e


def f(x):
    if x < 2:
        return False

    for e in primes:
        if x % e == 0:
            return False

    return True


ans += n != 1

print(ans)

Solution (Python):
from math import ceil
n = int(input())
pf = []
t = n
if n == 1:
    print(0)
    exit()
for i in range(2, ceil(n ** 0.5) + 1):
    c = 0
    while t % i == 0:
        c += 1
        t //= i
    if c > 0: pf.append(c)
if t != 1: pf.append(1)

ans = 0
for i in pf:
    tmp = i
    j = 1
    while j <= tmp:
        tmp -= j
        ans += 1
        j += 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

a=int(input())
b=factorization(a)

sum=0

for i in b:
    counter=0
    for j in range(1,100):
        
        if i[1]>=1+(j+2)*(j-1)//2:
            counter=j
        else:
            break
    sum+=counter
if a==1:
  print(0)
else:
  print(sum)

Solution (Python):
ans = 0
N = int(input())
x = 2
while not N % x:
    ans += 1
    N //= x
    x *= 2
    
while not N % 2:
    N //= 2
    
i = 3

while i*i <= N:
    x = i
    while not N % x:
        ans += 1
        N //= x
        x *= i
        
    while not N % i:
        N //= i
        
    i += 2
    
if N > 1: ans += 1
print(ans)

Solution (Python):
from sys import stdin
import math
def I(): return int(stdin.readline().rstrip())

n = I()
m = n
l = []
for i in range(2,int(math.sqrt(n))+1):
    if n==1 or n<i:
        break
    if n%i==0:
        c = 0
        while n%i==0:
            n//=i
            c += 1
        for j in range(1,c+1):
            l.append(i**j)
    i += 1
if n!=1:
    l.append(n)

l.sort()
ans = 0
for i in l:
    if m==1 or m<i:
        break
    else:
        if not m%i:
            m/=i
            ans += 1

print(ans)

Solution (Python):
from math import sqrt
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
 
if N == 1:
    ans = 0
else:
    A = factorization(N)
    B = []
    for a in A:
        B.append(a[1])
        ans = 0
    for b in B:
        n = int((-1 + sqrt(8*b + 1)) / 2)
        ans += n
print(ans)

Solution (Python):
from collections import Counter
def factorization(n):
    a=[]
    for i in range(2,int(n**.5)+1):
        while n%i==0:
            n//=i
            a.append(i)
    if n!=1:
        a.append(n)
    return a
n=int(input())
A=factorization(n)
B=Counter(A)
count=0
for key,value in B.items():
    for i in range(1,value+1):
        if n%(key**i)==0:
            count+=1
            n//=(key**i)
        else:break
print(count)

Solution (Python):
from collections import defaultdict
from itertools import accumulate


def main():
    n = int(input())
    prime_counter = defaultdict(int)
    acc = tuple(accumulate(range(1, 42)))  

    f = 2
    while n % f == 0:
        n //= f
        prime_counter[f] += 1
    f = 3
    while f * f <= n:
        if n % f == 0:
            n //= f
            prime_counter[f] += 1
        else:
            f += 2
    if n != 1:
        prime_counter[n] += 1

    ans = 0
    for c in prime_counter.values():
        for accum_index, x in enumerate(acc):
            if c < x:
                break
        ans += accum_index
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
from collections import defaultdict
from itertools import accumulate


def main():
    n = int(input())
    prime_counter = defaultdict(int)
    acc = tuple(accumulate(range(1, 42)))  

    f = 2
    while f * f <= n:
        if n % f == 0:
            n //= f
            prime_counter[f] += 1
        else:
            f += 1
    if n != 1:
        prime_counter[n] += 1

    ans = 0
    for c in prime_counter.values():
        for i, x in enumerate(acc):
            if c < x:
                tmp = i
                break
        ans += tmp
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
from collections import defaultdict
from itertools import accumulate


def main():
    n = int(input())
    prime_counter = defaultdict(int)
    acc = tuple(accumulate(range(1, 42)))  

    f = 2
    while n % f == 0:
        n //= f
        prime_counter[f] += 1
    f = 3
    while f * f <= n:
        if n % f == 0:
            n //= f
            prime_counter[f] += 1
        else:
            f += 2
    if n != 1:
        prime_counter[n] += 1

    ans = 0
    for c in prime_counter.values():
        for i, x in enumerate(acc):
            if c < x:
                tmp = i
                break
        ans += tmp
    print(ans)


if __name__ == '__main__':
    main()

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


def pr(n):
    L = []
    for i in range(2,int(n**0.5)+1):
        while n % i==0:
            L.append(i)
            n = n//i
    if n != 1:
        L.append(n)
    return L
dic = {1:1,2:1,3:2,4:2,5:2,6:3,7:3,8:3,9:3,10:4,11:4,12:4,13:4,14:4,15:5,16:5,17:5,18:5,19:5,20:5,21:6,22:6,23:6,24:6,25:6,27:6,28:7,29:7,30:7,31:7,32:7,33:7,34:7,35:7,36:8,39:8,40:8}
L = pr(n)

L = Counter(L)
num = 0
for k,v in L.items():
    num +=dic[v]
print(num)

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

d = 2
ans = 0

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

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

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

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

from collections import Counter

f = prime_factor(n)
c = Counter(f)
res = 0
for k, v in c.items():
    num = c[k] 
    i = 1
    while num >= i:
        num -= i
        res += 1
        i += 1

print(res)

Solution (Python):
N = int(input())
def factorize(N):
    n = N
    r = []
    for i in range(2,int(N**0.5)+1): 
        cnt = 0
        while(n%i==0):
            cnt += 1
            n //= i 
        if cnt!=0:
            r.append((i,cnt))
    if n!=1:
        r.append((n,1))
    return r

ans = 0
for _, cnt in factorize(N):
    i = 1
    while(i <= cnt):
        cnt-=i
        i+=1
        ans+=1
print (ans)

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

def factorization(n):
    arr = []
    for i in range(2,int(math.sqrt(n))+1):
        cnt = 0
        if n % i == 0:
            while n % i ==0:
                n //= i
                cnt +=1
            
            arr.append(cnt)
    if n != 1:
        
        arr.append(1)
    return arr
N = int(read())
arr = factorization(N)
ans = 0 
for a in arr:
  for i in range(1,50):
    if a-i>=0:
      a -=i
      ans +=1
    else:
      break
print(ans)