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):
N = int(input())
n, p, score = N, 2, 0
while p ** 2 <= N and n > 1:
  e = 1
  while n % (p ** e) == 0:
    n //= (p ** e)
    score += 1
    e += 1
  else:
    while n % p == 0:
      n //= p
    p += 2 - (p == 2)
else:
  score += n > 1
print(score)

Solution (Python):
import math
n = int(input())
ans = 0
k = int(math.sqrt(n)) + 1

for i in range(2,k):
    p = 1
    while n%(i**p)==0:
        ans+=1
        n = n//(i**p)
        p+=1
        
    while n % i == 0:
        n //= i

    if n<i: break

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

Solution (Python):
N = int(input())
n, p, score = N, 2, 0
while p ** 2 <= N:
  e = 1
  while n % (p ** e) == 0:
    n //= (p ** e)
    score += 1
    e += 1
  else:
    while n % p == 0:
      n //= p
    p += 2 - (p == 2)
else:
  score += n > 1
print(score)

Solution (Python):
N = int(input())
n, p, score = N, 2, 0
while p ** 2 <= N:
  e = 1
  while n % (p ** e) == 0:
    n //= (p ** e)
    score += 1
    e += 1
  else:
    while n % p == 0:
      n //= p
    p += 2 - (p == 2)
else:
  score += (n > 1)
print(score)

Solution (Python):
N = int(input())
n, p, score = N, 2, 0
while p ** 2 <= N:
  e = 1
  while n % (p ** e) == 0:
    n //= (p ** e)
    score += 1
    e += 1
  else:
    while n % p == 0:
      n //= p
    p = p + 1 if p == 2 else p + 2
else:
  if n != 1:
    score += 1
print(score)

Solution (Python):
N = int(input())
n, p, score = N, 2, 0
while p ** 2 <= N:
  e = 1
  while n % (p ** e) == 0:
    n //= (p ** e)
    score += 1
    e += 1
  else:
    while n % p == 0:
      n //= p
    p += 1
else:
  if n != 1:
    score += 1
print(score)

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

result = 0

n = N
e = 0
while True:
    if n%2 == 0:
        n = n//2
        e += 1
    else:
        m = 1
        while e >= m:
            e -= m
            result += 1
            m += 1
        break

p = 3
e = 0
l = int(N**(1/2))
while True:
    if n%p == 0:
        n = n//p
        e += 1
    else:
        m = 1
        while e >= m:
            e -= m
            result += 1
            m += 1
        e = 0
        p += 2
        if p >= l:
            break

if n != 1 and N != 1:
    result += 1

print(result)

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

s = factorization(n)

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

count,ans = 1,0
for i in range(len(s)):
    while(s[i][1] >= count):
        ans += 1
        s[i][1] -= count
        count += 1
    count = 1

print(ans)

Solution (Python):
def primefactorize(n) :
    res = []
    if n%2 == 0 :
        t = 0
        while n%2 == 0 :
            n //= 2
            t += 1
        res.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
        res.append((i,t))
        if n == 1 :
            break
    if n != 1 :
        res.append((n,1))
    return res


N = int(input())
res = 0
for p, e in primefactorize(N) :
    i = 1
    while e >= i :
        res += 1
        e -= i
        i += 1
print(res)

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):
from math import sqrt
itl = lambda: list(map(float, input().strip().split()))


def solve():
    N = int(input())
    if N == 1:
        return 0

    ans = 0
    for i in range(2, int(sqrt(N)) + 1):
        nxt = 1
        count = 0
        while N % i == 0:
            N //= i
            count += 1
            if count == nxt:
                count = 0
                ans += 1
                nxt += 1
    if N > int(sqrt(N)):
        ans += 1        
    return ans

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

Solution (Python):
import sys
import math


def is_prime(N):
    if N == 1:
        return False
    i = 2
    while i * i <= N:
        if N % i == 0:
            return False
        i += 1
    return True

def prime(N):
    prime = []
    is_prime = []  
    for i in range(N):
        if i * i > N:
            break
        is_prime.append(True)
    is_prime[0] = is_prime[1] = False 
    n = len(is_prime)
    for i in range(2, n):
        if is_prime[i]:
            
            prime.append(i)
            for j in range(2 * i, n, i):
                
                is_prime[j] = False
    
    return prime, n

def main():
    N = int(input())
    if N == 1:
        print(0)
    else:
        if is_prime(N):
            print(1)
        else:
            prime_list, n = prime(N)
            used = []
            prime_exponentiation = []
            count = 0
            for i in range(len(prime_list)):
                now = prime_list[i]
                j = 1
                while now ** j <= N:
                    prime_exponentiation.append(now ** j)
                    j += 1
            prime_exponentiation.sort()
            for i in range(len(prime_exponentiation)):
                now = prime_exponentiation[i]
                if N < now:
                    j = 0
                    while not is_prime(N):
                        if N == 1:
                            break
                        while N % prime_list[j] == 0:
                            N //= prime_list[j]
                        j += 1 
                    break
                if N % now == 0:
                    count += 1
                    used.append(now)
                    N //= now
            if N not in used and N != 1:
                count += 1
            print(count)


if __name__ == '__main__':
    main()

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

ans = 0
prime_check = [1]*1000100
count = 2
while num>1:
    if prime_check[count]==1: 
        tmp = 0
        while num % count == 0: 
            num/= count
            tmp += 1
        tmp2 =1
        while tmp>=tmp2: 
            ans += 1
            tmp -= tmp2
            tmp2 += 1
        tmp = count
        while tmp*count<=1e6:
            prime_check[tmp*count] = 0
            tmp += 1
    count += 1
    if(count>1e6):
        num = 0
        ans += 1
print(ans)

Solution (Python):
N = int(input())
a = []
count =0
count2 = 0
count3 = 0
X=int(N**0.5)
for i in range(X+1):
	if i ==0 or i == 1:
		pass
	elif N % i == 0:

		while N % i==0:
			N /= i
			count2 += 1
		j =1
		count3 = 0
		while count2 - j >=0:
			count2 -= j
			j = j+1
			count3 += 1 
		count += count3 		
		count2 = 0            
if  N >1:
	count +=1
print(count)

Solution (Python):
from collections import defaultdict, Counter
from fractions import Fraction
import math


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:
    print(0)
    exit()
result = Counter(prime_factorize(N))

count = 0
for key in result.keys():
    v = result[key]
    i = 1
    while(v >= i):
        v -= i
        count += 1
        i += 1
print(count)

Solution (Python):
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(n**0.5)+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(int(input()))
b = [1, 3, 6, 10, 15, 21, 28, 36, 43]

ans = 0

if len(a) == 1 and a[0][0] == 1:
  print(0)
  exit()
  
for i in a:
  for j in range(len(b)):
    if i[1] < b[j]:
      ans+=j
      break
    
print(ans)

Solution (Python):
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5))+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(int(input()))
b = [1, 3, 6, 10, 15, 21, 28, 36, 43]

ans = 0

if len(a) == 1 and a[0][0] == 1:
  print(0)
  exit()
  
for i in a:
  for j in range(len(b)):
    if i[1] < b[j]:
      ans+=j
      break
    
print(ans)

Solution (Python):
N = int(input())
n, p, score = N, 2, 0
while p ** 2 <= N:
  e = 1
  while n >= (p ** e) and n % (p ** e) == 0:
    n //= (p ** e)
    score += 1
    e += 1
  else:
    while n >= p and n % p == 0:
      n //= p
    p += 1
else:
  if n != 1:
    score += 1
print(score)

Solution (Python):
import collections
n=int(input())
a=[]
count=0
while n%2==0:
    a.append(2)
    n=n/2
num=3
while num**2<=n+1:
    if n%num==0:
        a.append(num)
        n=n/num
    else:
        num+=2
if n!=1:
    a.append(n)
a=collections.Counter(a)
for i in a.values():
    x=1
    while x<=i:
        count+=1
        i-=x
        x+=1
print(count)

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

n = N
i = 2
while i <= N**0.5:
    if n%i != 0:
        i += 1
        continue
    
    N_prime.append(i)
    n = n/i
    if n == 1:
        break

if N_prime == [] and N != 1:
    N_prime.append(N)
elif n != 1:
    N_prime.append(int(n))

ct = []
for i in N_prime:
    if i not in ct:
        ct.append(i)
        temp_i = 1
        continue
    temp_i *= i
    if temp_i not in ct:
        ct.append(temp_i)
        temp_i = 1
        continue

print(len(ct))

Solution (Python):
from collections import Counter

def get_prime_factors(x):
    out = []
    if x < 1:
        return out
    while not x%2:
        out.append(2)
        x //= 2
    i = 3
    while i*i <= x:
        if not x%i:
            out.append(i)
            x //= i
        else:
            i += 2
    if x != 1:
        out.append(x)
    return out
    
def main():
    n = int(input())
    ans = 0
    primes = Counter(get_prime_factors(n))
    for k, v in primes.items():
        num = 1
        while v >= num:
            v -= num
            num += 1
            ans += 1
    print(ans)
    

if __name__ == "__main__":
    main()

Solution (Python):
from collections import defaultdict
import math


def find(x):
  limit = math.sqrt(x)
  p = 2
  while True:
    if limit < p:
      d[x] += 1
      return 0
    if x%p == 0:
      d[p] += 1
      return find(x//p)
    p += 1
  

def extract(y):
  cnt  = 1
  patn = 0
  while True:
    y -= cnt
    patn += 1
    cnt += 1
    
    if y == 0:
      return patn
    elif y < 0:
      return patn-1

N = int(input())

d = defaultdict(int)

if N == 1:
  print(0)
else:
  _ = find(N)
  cnt = 0
  for i in d.keys():
    cnt += extract(d[i])
  print(cnt)

Solution (Python):


import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
ans = 0
for i in range(2, int(math.sqrt(n)) + 1):
    if n % i == 0:
        cnt = 0
        while n % i == 0:
            cnt += 1
            n //= i
        tmp = 1
        while cnt >= tmp:
            ans += 1
            cnt -= tmp
            tmp += 1
if n != 1:
    ans += 1
print(ans)

Solution (Python):
from math import floor

arr = []

def factorization(n):
    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])

    
    
n = int(input())
if n == 1:
  print(0)
  exit()
  
factorization(n)
ans = 0

for prime,power in arr:
  ans += floor((-1+(1+8*power)**0.5)/2)
  
print(ans)

Solution (Python):
def f(n):
  p=[]
  if n%2==0:
    c=0
    while n%2==0:
      c+=1
      n/=2
    p.append(c)
  for i in range(3,int(n**0.5)+1,2):
    if n%i==0:
      c=0
      while n%i==0:
        c+=1
        n/=i
      p.append(c)
  if n!=1:
    p.append(1)
  return p
  
N=int(input())
p=f(N)
r=0
while p:
  r+=int(((8*p.pop()+1)**0.5-1)/2)
print(r)

Solution (Python):
from math import floor

arr = []

def factorization(n):
    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])
    
n = int(input())
if n == 1:
  print(0)
  exit()
  
factorization(n)
ans = 0

for prime,power in arr:
  ans += floor((-1+(1+8*power)**0.5)/2)
  
print(ans)

Solution (Python):
N=int(input())
p=[]
r=0

if N%2==0:
  c=0
  while N%2==0:
    N=N//2
    c+=1
  p.append(c)
for i in range(3,int(N**0.5)+1,2):
  if N%i==0:
    c=0
    while N%i==0:
      N=N//i
      c+=1
    p.append(c)
if N!=1:
  p.append(1)
  
while p:
  r+=int(((8*p.pop()+1)**0.5-1)/2)
  
print(r)

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

"""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

def cnt(n):
    count = 1
    while n>=count:
        n -= count
        count+=1
    return count-1

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

lst = factorization(n)
for i in lst:
    ans += cnt(i[1])

print(ans)

Solution (Python):
N=int(input())
def divisor_enu(N):
   l=[]
   for i in range(2,int(N**0.5)+1):
      cnt=0
      if N%i==0:
         while N%i==0:
            cnt+=1
            N//=i
         l.append(cnt)
   if N != 1:
      l.append(1)
   return l
l=divisor_enu(N)
ans=0
for i in l:
   for j in range(1,11):
      if i >= (1+j)*j//2:
         ans+=1
print(ans)

Solution (Python):
N=int(input())
p=[]
r=0

if N%2==0:
  c=0
  while N%2==0:
    c+=1
    N/=2
  p.append(c)
  
for i in range(3,int(N**0.5)+1,2):
  if N%i==0:
    c=0
    while N%i==0:
      c+=1
      N/=i
    p.append(c)
  
if N!=1:
  p.append(1)
  
for i in p:
  r+=int(((8*i+1)**0.5-1)/2)
print(r)

Solution (Python):
N=int(input())
p=[]
r=0

if N%2==0:
  c=0
  while N%2==0:
    c+=1
    N/=2
  p.append([c])
  
i=3
while i<N**0.5+1:
  if N%i==0:
    c=0
    while N%i==0:
      c+=1
      N/=i
    p.append([c])
  i+=2
  
if N!=1:
  p.append([1])
  
for i in range(len(p)):
  j=1
  while p[i][0]>=j:
    p[i][0]-=j
    j+=1
    r+=1
    
print(r)

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

if N%2==0:
  count=0
  while N%2==0:
    count+=1
    N/=2
  p_list.append([2,count])

i=3
while i<N**0.5+1:
  if N%i==0:
    count=0
    while N%i==0:
      count+=1
      N/=i
    p_list.append([i,count])
  i+=2

if N!=1:
  p_list.append([int(N),1])

result=0
for i in range(len(p_list)):
  j=1
  while p_list[i][1]>=j:
    p_list[i][1]-=j
    j+=1
    result+=1
print(result)

Solution (Python):
n = int(input())
x = n
soinsuubunkai = []
for i in range(2,int(x**(1/2))+1):
         if n % i == 0:
                  soinsuu = i
                  zyousuu = 0
                  while n % i == 0:
                           n = n // i
                           zyousuu += 1
                  soinsuubunkai.append([soinsuu,zyousuu])
if n != 1:
         soinsuubunkai.append([n,1])

ans = 0
for i in range(len(soinsuubunkai)):
         for j in range(1,100):
                  soinsuubunkai[i][1] -= j
                  if soinsuubunkai[i][1] < 0:
                           break
                  else:
                           ans += 1

print(ans)

Solution (Python):
def factor(n):
    arr = []
    temp = n
    for i in range(2, int(n**0.5)+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 == [] and n != 1:
        arr.append([n, 1])
    return arr

n = int(input())
fact_n = factor(n)
cnt = 0
for _, e in fact_n:
    i = 1
    while i <= e:
        e -= i
        i += 1
    cnt += i - 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

a = factorization(int(input()))
b = [1, 3, 6, 10, 15, 21, 28, 36, 43]

ans = 0

if len(a) == 1 and a[0][0] == 1:
  print(0)
  exit()
  
for i in a:
  for j in range(len(b)):
    if i[1] < b[j]:
      ans+=j
      break
    
print(ans)

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

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

cnt = 0
for p, e in factorize(n):
    i = 1
    while e >= i:
        cnt += 1
        e -= i
        i += 1
print(cnt)

Solution (Python):


from collections import Counter

n = int(input())

def factorize(n):
    f = Counter()
    d = 2
    while d * d <= n:
        if n % d == 0:
            f[d] += 1
            n //= d
        else:
            d += 1
    if 1 < n:
        f[n] += 1
    return f

f = factorize(n)

s = 0
for d in f:
    
    x = 1
    while x * (x+1)//2 <= f[d]:
        x += 1
    s += x - 1
print(s)

Solution (Python):
def factorize(n):
    x = 2
    f = []
    while x**2 <= n:
        c = 0
        if n % x != 0:
            x += 1
            continue
        else:
            while n % x == 0:
                n //= x
                c += 1
            f.append([x, c])
        x += 1

    if n > 1:
        f.append([n, 1])
    return f

n = int(input())
f = factorize(n)
ans = 0
for el in f:
    m = el[1]
    i = 1
    while True:
        if i*(i+1)//2 > m:
            ans += i-1
            break
        i += 1

print(ans)

Solution (Python):
def factorint(n):
    d = dict()
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            c = 0
            while n % i == 0:
                c += 1
                n /= i
            d[i] = c
    if n != 1:
        d[n] = 1
    return d

n = int(input())
c = 0
for i, j in factorint(n).items():
    for k in range(j):
        if n % i ** (k + 1) == 0:
            n = n / i ** (k + 1)
            c += 1
        else:
            break
print(c)

Solution (Python):
import math
N = int(input())
if N == 1:
    print(0)
    exit()
div = {}
for i in range(2, int(math.sqrt(N))+1):
    while N % i == 0:
        N = N // i
        if i in div:
            div[i] += 1
        else:
            div[i] = 1
    if N == 1:
        break
if N != 1:
    div[N] = 1
ans = 0
for v in div.values():
    i = 1
    while v >= i:
        v -= i
        i += 1
        ans += 1
print(ans)

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

n = int(input())

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

ar = factorization(n) 
ar_len = len(ar)
ans = 0
for i in range(ar_len):
    jo = ar[i][1]
    ad = 0
    for j in range(1000):
        base = j*(j+1)/2
        if jo < base:
            ad = j-1
            break
    ans = ans + ad

print(ans)

Solution (Python):
N = int(input())
n, p, score = N, 2, 0
while p ** 2 <= N:
  e = 1
  while n >= (p ** e) and n % (p ** e) == 0:
    n //= (p ** e)
    score += 1
    e += 1
  else:
    while n >= p and n % p == 0:
      n //= p
    p = p + 1 if p == 2 else p + 2
else:
  if n != 1:
    score += 1
print(score)

Solution (Python):
import numpy as np
import sys



def xnxn(n=0):
    """
    args:
        int n: a number of lows to read
    example:
        input   1
        retrun  1

        input   1 2 3
        return  [1,2,3]
        input   1 2 3
                4
        return  [[1,2,3],
                [4]]
    """
    if n == 0:
        temp = list(map(int, input().split()))
        if len(temp) == 1:
            return temp[0]
        elif len(temp) > 1:
            return temp
    else:
        temp = [list(map(int, input().split())) for _ in range(n)]
        return temp


def sp_xnxn(n=0):
    """
    args:
        int n: a number of lows to read
    example
        input   1
        retrun  [1]

        input   123
        return  [1,2,3]

        input   123
                4
        return  [[1,2,3],
                [4]]
    """
    if n == 0:
        return [int(k) for k in xsxs()]
    else:
        return [[int(k) for k in xsxs()] for _ in range(n)]


def xsxs(n=0):
    """
    args:
        int n: a number of lows to read
    example:
        input   AA
        retrun  AA

        input   A BBB CC
        return  ["A","BBB","CC"]

        input   A BB CCC
                D
        return  [["A","BBB","CC"],
                ["D"]]
    """
    if n == 0:
        temp = list(input().split())
        if len(temp) == 1:
            return temp[0]
        elif len(temp) > 1:
            return temp
    else:
        return [list(input().split()) for _ in range(n)]


def sp_xsxs(n=0):
    """
    args:
        int n: a number of lows to read
        example:
            input   A
            retrun  ["A"]

            input   ABC
            return  ["A","B","C"]

            input   ABC
                    D
            return  [["A","B","C"],
                    ["D"]]
    """
    if n == 0:
        return [s for s in xsxs()]
    else:
        return [[s for s in xsxs()] for _ in range(n)]


def p_num(a):

    if a == 1:
        return [[a, 1]]
    else:
        tmp = 2
        ans = []
        while tmp < np.sqrt(a) + 1:
            n = 0
            p = [tmp]

            while a % tmp == 0:
                a = int(a / tmp)
                
                n += 1
                c = 1
            if n != 0:
                p.append(n)
                ans.append(p)
            tmp += 1
            c = 0
        if c == 0 and a != 1:
            ans.append([a, 1])
        return ans


def p_num_edit(n):
    tmp = n
    ans = []
    for i in range(2, int(np.sqrt(n)) + 1):
        cnt = 0
        while tmp % i == 0:
            cnt += 1
            tmp = int(tmp / i)
        if cnt > 0:
            ans.append([i, cnt])
    if tmp != 1:
        ans.append([tmp, 1])
    if ans == []:
        ans.append([n, 1])
    return ans


n = xnxn()

if n == 1:
    print(0)
    sys.exit()
else:
    a = p_num_edit(n)
    c = 0
    for num in a:
        i = 1
        while num[1] - i > -1:
            num[1] -= i
            i += 1
            c += 1
    print(c)

Solution (Python):
import math
def isPrime(n):
  if n<2:
    return False
  if n == 2:
    return True
  if n % 2 == 0:
    return False
  m = math.floor(math.sqrt(n))
  for p in range(3,n+1,2):
      if n % p == 0:
        return False
      if p > m:
        
        break
  return True
N=int(input())
if isPrime(N):
    print(1)
else:
    n=N
    count=0
    s=0
    S=0
    for i in range(2,N+1):
        if n<i:
            break
        s=1
        count=0
        while 1:
            if n%i!=0:
                break
            count+=1
            n=int(n/i)
        while 1:
            if count<int(s*(s+1)/2):
                S+=s-1
                break
            s+=1
        if i==10000:
            if isPrime(n):
                S+=1
                break
    print(S)

Solution (Python):
N = int(input())
n, p, score = N, 2, 0
while p ** 2 <= N:
  e = 1
  while n >= (p ** e) and n % (p ** e) == 0:
    n //= (p ** e)
    score += 1
    e += 1
  else:
    while n >= p and n % p == 0:
      n //= p
    p = p + 1 if p == 2 else p + 2
else:
  if n != 1:
    score += 1
print(score)

Solution (Python):
N = int(input())
n, p, score = N, 2, 0
while p ** 2 <= N:
  e = 1
  
  while n >= (p ** e) and n % (p ** e) == 0:
    n = n // (p ** e)
    score += 1
    e += 1
  else:
    while n >= p and n % p == 0:
      n = n // p
    p = p + 1 if p == 2 else p + 2
else:
  if n != 1:
    score += 1
print(score)

Solution (Python):
import numpy as np
import sys



def xnxn(n=0):
    """
    args:
        int n: a number of lows to read
    example:
        input   1
        retrun  1

        input   1 2 3
        return  [1,2,3]
        input   1 2 3
                4
        return  [[1,2,3],
                [4]]
    """
    if n == 0:
        temp = list(map(int, input().split()))
        if len(temp) == 1:
            return temp[0]
        elif len(temp) > 1:
            return temp
    else:
        temp = [list(map(int, input().split())) for _ in range(n)]
        return temp


def sp_xnxn(n=0):
    """
    args:
        int n: a number of lows to read
    example
        input   1
        retrun  [1]

        input   123
        return  [1,2,3]

        input   123
                4
        return  [[1,2,3],
                [4]]
    """
    if n == 0:
        return [int(k) for k in xsxs()]
    else:
        return [[int(k) for k in xsxs()] for _ in range(n)]


def xsxs(n=0):
    """
    args:
        int n: a number of lows to read
    example:
        input   AA
        retrun  AA

        input   A BBB CC
        return  ["A","BBB","CC"]

        input   A BB CCC
                D
        return  [["A","BBB","CC"],
                ["D"]]
    """
    if n == 0:
        temp = list(input().split())
        if len(temp) == 1:
            return temp[0]
        elif len(temp) > 1:
            return temp
    else:
        return [list(input().split()) for _ in range(n)]


def sp_xsxs(n=0):
    """
    args:
        int n: a number of lows to read
        example:
            input   A
            retrun  ["A"]

            input   ABC
            return  ["A","B","C"]

            input   ABC
                    D
            return  [["A","B","C"],
                    ["D"]]
    """
    if n == 0:
        return [s for s in xsxs()]
    else:
        return [[s for s in xsxs()] for _ in range(n)]


def p_num(a):

    if a == 1:
        return [[a, 1]]
    else:
        tmp = 2
        ans = []
        while tmp < np.sqrt(a) + 1:
            n = 0
            p = [tmp]

            while a % tmp == 0:
                a = int(a / tmp)
                
                n += 1
                c = 1
            if n != 0:
                p.append(n)
                ans.append(p)
            tmp += 1
            c = 0
        if c == 0 and a != 1:
            ans.append([a, 1])
        return ans


n = xnxn()

if n == 1:
    print(0)
    sys.exit()
else:
    a = p_num(n)
    c = 0
    for num in a:
        i = 1
        while num[1] - i > -1:
            num[1] -= i
            i += 1
            c += 1
    print(c)

Solution (Python):
def solve(n):
    for i in range(n+2):
        if (i+1)*i//2 > n:
            return i-1

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


    return arr



N = int(input())
li = factorization(N)
ans = 0
for [a,b] in li:
    ans += solve(b)
    
if ans == 0:
    if N != 1:
        ans += 1
print(ans)