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 collections

n = int(input())

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

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

c = collections.Counter(prime_factorize(n))
counts = c.values()
ans = 0

for i in counts:
    x = 0
    for j in range(i):
        x += j + 1
        if i >= x:
            ans += 1
        else:
            break

print(ans)

Solution (Python):
import collections

n = int(input())

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

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

c = collections.Counter(prime_factorize(n))
_, counts = zip(*c.most_common())

l = list(counts)
ans = 0

if l == [1]: 
    print(1)
    exit()

for i in l:
    for j in range(1, i+1):
        if i >= j:
            i -= j
            ans += 1

print(ans)

Solution (Python):
def find_primes(n):
    ps = []
    t = [True] * n
    t[0] = t[1] = False
    for i in range(2, n):
        if not t[i]:
            continue
        ps.append(i)
        for j in range(i, n, i):
            t[j] = False
    return ps


def solve(string):
    n = int(string)
    if n == 1:
        return "0"
    rn = int(n**0.5 + 1)
    ps = find_primes(rn)
    ans = 0
    for i in ps:
        k = 1
        while n % (i**k) == 0:
            ans += 1
            n //= i**k
            k += 1
    return str(ans + (n >= rn))


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))

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

def divGame(N=n):
  if N == 1:
    return 0
  if N == 2:
    return 1
  
  factors = []

  for i in range(2, int(N**0.5 + 1)):
    count = 0
    while N % i == 0:
      N /= i
      count += 1
    if count != 0:
      factors.append(count)
  if N != 1:
    factors.append(1)

  factors.sort()

  answer = 0
  accum = 1
  count = 1
  for i in range(len(factors)):
    while factors[i] >= accum:
      count += 1
      accum += count
    answer += count - 1

  return answer

print(divGame())

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

pf = {}


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>1: pf[n] = 1

num_group = [0]*11 
for i in range(10):
    num_group[i+1] = num_group[i] + (i+1)


ans = 0
for prime in pf.keys():
    for i in range(1,11):
      if pf[prime]<num_group[i]:
          break
    ans += i-1
print(ans)

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

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

L=prime_factorize(n)
M=L.copy()
M=list(set(M))

cnt=0
for x in M:
    m=L.count(x)
    for i in range(L.count(x)):
        if m-i-1 >= 0:
            m -= i+1
            cnt += 1

print(cnt)

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

def f(n):
    for i in range(1,20):
        if n<(i*(i+1))//2:
            return i-1

n = int(input())
c = collections.Counter(prime_factorize(n))
ans = 0
for i in c.keys():
    ans += f(c[i])
print(ans)

Solution (Python):
import collections

n = int(input())

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

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

c = collections.Counter(prime_factorize(n))
_, counts = zip(*c.most_common())

l = list(counts)
ans = 0

for i in l:
    x = 0
    for j in range(i):
        x += j + 1
        if i >= x:
            ans += 1
        else:
            break

print(ans)

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




'''
a,b=[],[]
for i in range():
    A, B = map(int, input().split())
    a.append(A)   
    b.append(B)'''

n=int(input())
def soinsuu(n):
    
    
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
from collections import Counter
a=Counter(soinsuu(n))
if n==1:
    print(0)
    sys.exit()

cnt=0
for i in range(1,1+max(a.values())):
    for item in a.keys():
        
        if n%(item**i)==0:
            n//=item**i
            
            cnt+=1
            if n==1:
                break

print(cnt)

Solution (Python):
import math

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

n=int(input())
P=prime(n)
P=sorted(P)
num=n
if 1 in P:
	print(0)
else:
	ans=0
	tmp=0
	for i in range(0,len(P)):
		if i==0:
			tmp=P[i] 
		elif P[i]==P[i-1]:
			tmp*=P[i]
		else:
			tmp=P[i]
			num=n
		if num%tmp==0:
			num/=tmp
			ans+=1
			
	print(ans)

Solution (Python):
n = int(input())
m = n
primes = {}

for i in range(2, int(n**0.5+2)):
  while m % i == 0:
    m //= i
    if i not in primes:
      primes[i] = 1
    else:
      primes[i] += 1
  if i > m:
    break

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

cnt = 0
num = 0
flag = True

while flag == True:
  num += 1
  flag = False
  for i in primes:
    if 0 < primes[i] <= num*2:
      cnt += 1
      primes[i] = 0
    elif primes[i] > num*2:
      cnt += 1
      flag = True
      primes[i] -= num

print(cnt)

Solution (Python):
'''
Created on 2020/08/23

@author: harurun
'''
def f(n):
  arr=[]
  temp=n
  for c in range(2,int(-(-n**0.5//1))+1):
    if temp%c==0:
      cnt=0
      while temp%c==0:
        cnt+=1
        temp//=c
      arr.append([c,cnt])
  if temp!=1:
    arr.append([temp,1])
  return arr

def main():
  import math
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write

  N=int(pin())
  r=f(N)
  ans=0
  for i in r:
    ans+=int((math.sqrt(1+8*i[1])-1)/2)
  print(ans)
  return 
main()

Solution (Python):
n=int(input())
def f(x):
    z=1
    while not(z*(z+1)<=2*x<(z+1)*(z+2)):
        z+=1
    return z

x=[-1]*(10**6+1) 
x[0]=0
x[1]=1
i=2
prime=[]
while i<=10**6:
    if x[i]==-1:
        x[i]=i
        prime.append(i)
    for j in prime:
        if i*j>10**6 or j>x[i]:break
        x[j*i]=j
    i+=1
if n==1:
    print(0)
    exit()

a=[]
q=0
for i in range(len(prime)):
    p=prime[i]
    while n%p==0:
        q+=1
        n=n//p
    if q>0:a.append(q)
    q=0

ans=0
for i in range(len(a)):
    ans+=f(a[i])
print(ans if n==1 else ans+1)

Solution (Python):
n=int(input())
def f(x):
    z=1
    while not(z*(z+1)<=2*x<(z+1)*(z+2)):
        z+=1
    return z

x=[-1]*(10**6+1) 
x[0]=0
x[1]=1
i=2
prime=[]
while i<=10**6:
    if x[i]==-1:
        x[i]=i
        prime.append(i)
    for j in prime:
        if i*j>10**6 or j>x[i]:break
        x[j*i]=j
    i+=1
if n==1:
    print(0)
    exit()
y=0
j=2
while j*j<=n:
    if n%j==0:
        y=1
    j+=1
if y==0:
    print(1)
    exit()
a=[]
q=0
for i in range(len(prime)):
    p=prime[i]
    while n%p==0:
        q+=1
        n=n//p
    if q>0:a.append(q)
    q=0

ans=0
for i in range(len(a)):
    ans+=f(a[i])
print(ans if n==1 else ans+1)

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
class Sieve2: 
    def __init__(self,n):
        self.primes=[]
        self.f=[0]*(int(n**0.5)+1) 
        self.f[0]=self.f[1]=-1
        for i in range(2,int(n**0.5)+1): 
            if self.f[i]: continue
            self.primes.append(i)
            self.f[i]=i
            for j in range(i*i,int(n**0.5)+1,i):
                if not self.f[j]:
                    self.f[j]=i  

    def prime_fact(self,x): 
        fact_dict=dict()
        for p in self.primes:
            if p*p>x:break
            while x%p==0:
                x//=p
                fact_dict[p]=fact_dict.get(p,0)+1
        if x>1:fact_dict[x]=fact_dict.get(x,0)+1
        return fact_dict

def main():
    n = int(input())
    Sieve = Sieve2(n)
    prime_dict = Sieve.prime_fact(n)
    ans = 0
    for fact in prime_dict.values():
        f = fact
        x = 1
        while f > 0:
            if f >= x:
                ans += 1
            f -= x
            x += 1
    print(ans)


if __name__=='__main__':
    main()

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
class Sieve2: 
    def __init__(self,n):
        self.primes=[]
        self.f=[0]*(int(n**0.5)+1) 
        self.f[0]=self.f[1]=-1
        for i in range(2,int(n**0.5)+1): 
            if self.f[i]: continue
            self.primes.append(i)
            self.f[i]=i
            for j in range(i*i,int(n**0.5)+1,i):
                if not self.f[j]:
                    self.f[j]=i  

    def prime_fact(self,x): 
        fact_dict=dict()
        for p in self.primes:
            if p*p>x:break
            while x%p==0:
                x//=p
                fact_dict[p]=fact_dict.get(p,0)+1
        if x>1:fact_dict[x]=fact_dict.get(x,0)+1
        return fact_dict

def main():
    n = int(input())
    Sieve = Sieve2(n)
    prime_dict = Sieve.prime_fact(n)
    ans = 0
    for fact in prime_dict.values():
        f = fact
        x = 1
        while f > 0:
            if f >= x:
                ans += 1
            f -= x
            x += 1
    print(ans)


if __name__=='__main__':
    main()

Solution (Python):
import collections
import sys
def input(): return sys.stdin.readline().rstrip()

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

N = int(input())
count = 0
prime_list = collections.Counter(prime_factorize(N))

for key in prime_list:
    num = prime_list[key]
    for i in range(1, num+1):
        if i <= num:
            num -= i
            count += 1
        else:
            break

print(count)

Solution (Python):
def prime_fact(n):
    primes = []
    i = 2
    while i * i <= n:
        cnt = 0
        while n % i == 0:
            n //= i
            cnt += 1
        if cnt:
            primes.append([i, cnt])
        i += 1

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

n = int(input())

primes = prime_fact(n)

cnt = 0
for i, j in primes:
    k = 1
    while k <= j:
        j -= k
        k += 1
        cnt += 1

print(cnt)

Solution (Python):
import math

def main():
	N = int(input())
	f = prime_factorize(N)
	cnt = 0
	if N == 1:
		print(cnt)
		return 0

	for p in f:
		prime = p[0]
		power = p[1]
		tmp = math.floor((math.sqrt(1 + 8 * power) - 1) / 2)
		cnt += tmp
	print(cnt)


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

	return ret

main()

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

big = 10**6+10

furui = [0]*big
furui[0]=1
furui[1]=1

for i in range(2,big):
    if furui[i]==0:
        for j in range(i,len(furui),i):
            furui[j] = 1
            furui[i]=0
        
prime = [i for i in range(len(furui)) if furui[i]==0]

soinsuu=[]
for p in prime:

    while n%p==0:
        n //= p
        soinsuu.append(p)

if n!=1:
    soinsuu.append(n)
    


ans=0

for i in set(soinsuu):
    
    kai = ((8*soinsuu.count(i)+1)**0.5 -1)/2
    ans += int(kai)
    
print(ans)

Solution (Python):
from collections import Counter

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

n = int(input())
c = Counter(prime_factorize(n))
v = list(c.values())

ans = 0
for i in v:
    k = i
    s = 0
    for j in range(1, i+1):
        s += j
        if s <= k:
            ans += 1
        else:
            break
print(ans)

Solution (Python):
import math

def solve():
    N = int(input())
    ans = 0
    for i in range(2, int(math.sqrt(N)) + 2):
        n = 1
        cnt = 0
        while N % i == 0:
            N //= i
            cnt += 1
            if cnt == n:
                cnt = 0
                n += 1
                ans += 1
    if N != 1:
        ans += 1
    return ans

print(solve())

Solution (Python):

def main():
    N = int(input())
    if N == 1:
        print(0)
        return
    n = N
    prime = [True for i in range(10**6+1)]
    prime[0] = False
    prime[1] = False
    for i in range(2, len(prime)):
        if prime[i] == True:
            for j in range(i*2, len(prime), i):
                prime[j] = False

    ans = 0
    for i in range(len(prime)):
        if prime[i] == True and n % i == 0:
            p = i
            flag = False
            while n % p == 0:
                ans += 1
                n = n//p
                p *= i
            while n % i == 0:
                n = n//i
    if 1 < n:
        ans += 1
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
pri_cnt = {}
n = N
i = 2

while i ** 2 <= N:
  while n % i == 0:
    if i not in pri_cnt:
      pri_cnt[i] = 1
    else:
      pri_cnt[i] += 1
    n = n / i
  if (i == 2):
    i += 1
  else:
    i += 2

if n > 1:
  pri_cnt[int(n)] = 1

ans = 0
for pri, cnt in pri_cnt.items():
  count = 1
  remain = cnt
  while remain >= count:
    ans += 1
    remain -= count
    count += 1
print(ans)

Solution (Python):
N = int(input())
pri_cnt = {}
n = N
i = 2

while i ** 2 <= N:
  while n % i == 0:
    if i not in pri_cnt:
      pri_cnt[i] = 1
    else:
      pri_cnt[i] += 1
    n = n / i
  if (i == 2):
    i += 1
  else:
    i += 2

if n > 1:
  pri_cnt[int(n)] = 1

ans = 0
for pri, cnt in pri_cnt.items():
  count = 1
  remain = cnt
  while remain >= count:
    ans += 1
    remain -= count
    count += 1
print(ans)

Solution (Python):
N = int(input())
res = {}
ans = 0
i = 2
 
for i in range(2,int(N**(1/2))+1) :
    while(N%i == 0) :
        if(i not in res) :
            res[i] = 1
        else :
            res[i] += 1
        N /= i
if(N != 1) :
    res[N] = 1
 

for i in res :
    b = 1
    s = res[i]
    while(b <= s) :
        ans += 1
        s -= b
        b += 1
print(ans)

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

def resolve():
    N = int(input())
    import collections
    factors = collections.Counter(prime_factors(N))
    numbers = [0,1,1,2,2,2,3,3,3,3,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9]
    cnt = 0
    for k, v in factors.items():
        cnt += numbers[v]
    print(cnt)


if '__main__' == __name__:
    resolve()

Solution (Python):
from collections import defaultdict

N = int(input())

def factorize(N):
    factors = defaultdict(int)
    i = 2
    while i * i <= N:
        factor = 0
        while N % i == 0:
            N //= i
            factor += 1
        if factor > 0:
            factors[i] = factor
        i += 1
    if N > 1:
        factors[N] = 1
    return factors

def to_cnt(n):
    i = 0
    while n >= i+1:
        n-=(i+1)
        i += 1
    return i

ans = 0
for _, n in factorize(N).items():
    ans += to_cnt(n)
print(ans)

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

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

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

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

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

    return arr
  
def divcount(n):
  cnt=0
  while n>=0:
    n-=cnt+1
    cnt+=1
  return cnt-1

s=factorization(N)
t=[i[1] for i in s]
ans=0
for i in t:
  ans+=divcount(i)
print(ans)

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

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

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

    return arr
N = int(input())
fac = factorization(N)
Answer = 0
for i in range(len(fac)):
    faci = fac[i][1]
    An = 1
    while faci >= An:
        Answer += 1
        faci -= An
        An +=1
if N == 1:
    Answer = 0
print(Answer)

Solution (Python):
a,n=0,int(input())
for i in range(2,10**6):
  x=j=0
  while n%i<1:n//=i;x+=1
  while x>j:a+=1;j+=1;x-=j
print(a+(n>1))

Solution (Python):
a,n=0,int(input())
for i in range(2,int(n**0.5+1)):
  x=0
  while(n%i==0):n//=i;x+=1
  j=1
  while(x>=j):a+=1;x-=j;j+=1
print(a+(n>1))

Solution (Python):
import bisect
n=int(input())
if n==1:
    print(0)
    exit()
def factorize(n):
    a=[]
    while n%2==0:
        a.append(2)
        n//=2
    f=3
    while f*f<=n:
        if n%f==0:
            a.append(f)
            n//=f
        else:
            f+=2
    if n!=1:
        a.append(n)
    return a
def ra(a):
    ll,l=[],1
    for i in range(len(a)-1):
        if a[i]==a[i+1]:
            l+=1
        else:
            ll.append(l)
            l=1
    ll.append(l)
    return ll
l=ra(factorize(n))
c=[1]
for i in range(2,10**4):
    c.append(i+c[-1])
ans=0
for i in l:
    ans+=bisect.bisect_left(c,i)
    if i in set(c):
        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())
soinnsuu=factorization(n)

def get_times(n):
    if n<3:
        return 1
    elif n<6:
        return 2
    elif n<10:
        return 3
    elif n<15:
        return 4
    elif n<21:
        return 5
    elif n<28:
        return 6
    elif n<36:
        return 7
    elif n<45:
        return 8
    else:
        return 9
ans=0
for i in soinnsuu:
    sisuu=i[1]
    ans+=get_times(sisuu)
if n==1:
    print(0)
else:
    print(ans)

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

n = int(input())
np = set(prime_factorize(n))
npl = []
for i in np:
    j = 1
    j *= i
    while j <= n:
        npl.append(j)
        j *= i
npl.sort()

cz = 2
ans = 0
for cz in npl:
    
    if cz > n:
        break
    if n % cz == 0:
        ans += 1
        n //= cz
print(ans)

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

n = int(input())
np = set(prime_factorize(n))
npl = []
for i in np:
    j = 1
    j *= i
    while j <= n:
        npl.append(j)
        j *= i
npl.sort()

cz = 2
ans = 0
for cz in npl:
    
    if cz > n:
        break
    if n % cz == 0:
        ans += 1
        n //= cz
print(ans)

Solution (Python):
import math

n = int(input())
d = n
m = {}

for i in range(2, int(math.sqrt(n)) + 1):
    m[i] = 0
    while (d % i == 0):
        d //= i
        m[i]+=1
res = 0
for i in m.values():
    res+=int(math.sqrt(i*2+0.25)-0.5)

if d > 1:
    res += 1
print(res)

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


d = 2
while d*d <= N:
  if N % d == 0:
    z = d
    while N % z == 0:
      N /= z
      ans += 1
      z *= d
    while N % d == 0:
      N /= d
  d += 1

if N > 1: ans += 1 
print(ans)

Solution (Python):
def factorize(N):
  fCount = []
  d = 2
  while d*d <= N:
    if N % d == 0:
      cnt = 0
      while N % d == 0:
        N //= d;
        cnt += 1
      fCount.append(cnt)
    d += 1

  if N > 1: 
    fCount.append(1)
    N = 1

  return fCount

N = int(input())
arr = factorize(N)
arr.sort()  

def triangle(k):
  return k * (k+1)//2

smallerTriangle = [0]*45 
for i in range(45):
  for j in range(1, 10000):
    if triangle(j) > i:
      smallerTriangle[i] = j-1
      break

ans = 0
for expo in arr:
  ans += smallerTriangle[expo]
print(ans)

Solution (Python):

import sys
from itertools import chain
import numpy as np
import math







def factorize(n: int):
    """nを素因数分解する"""
    
    count = 0
    while n % 2 == 0:
        count += 1
        n = n // 2
    if count > 0:
        arr = [(2, count)]
    else:
        arr = []

    
    for facter in range(3, n + 1, 2):
        if facter * facter > n:
            if n > 1:
                arr.append((n, 1))
            break
        count = 0
        while n % facter == 0:
            count += 1
            n = n // facter
        if count > 0:
            arr.append((facter, count))

    return arr


def case(n):
    t = 0
    i = 1
    while True:
        t += i
        if t > n:
            return i - 1
        i += 1


def solve(N: int):
    factors = factorize(N)
    answer = 0
    for f, count in factors:
        answer += case(count)
    return answer


def main():
    tokens = chain(*(line.split() for line in sys.stdin))
    
    N = int(next(tokens))  
    answer = solve(N)
    print(answer)


if __name__ == "__main__":
    main()

Solution (Python):
"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""

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

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

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

    return arr

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

ans = 0
for i in a:
  t = i[1]
  c=1
  tmp = 0
  while(tmp<=t):
    tmp+=c
    c+=1
  ans+=(c-2)
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
    

l_2d = factorization(N)

cnt = 0
for l in l_2d:
    p = l[0]
    e = l[1]
    if p == 1:
        continue
    for i in range(1, 10 ** 7):
        if e < i:
            break
        cnt += 1
        e -= i
print(cnt)

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

def prime_decomposition(x):
  i = 2
  ls = []
  while i * i <= x:
    while x % i == 0:
      x /= i
      ls.append(i)
    i += 1
  if x > 1:
    ls.append(int(x))
  return ls

def counter(n):
  i = 1
  while n > 0.5*(i+1)*(i+2)-1:
    i += 1
  return i

cnt = 0
numbers = prime_decomposition(N)
set_number = set(numbers)

for i in set_number:
  cnt += counter(numbers.count(i))
  
print(cnt)

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

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

Primes = Prime_Factorize(N)
cnt = 0
for p in Primes:
    e = 1
    z = p
    while (N%z == 0) and (N >= z):
        N //= z
        e += 1 
        z = p**e
        cnt += 1
    while N%p == 0:
        N //= p
print(cnt)

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

ans = 0
for i in range(2, N):
    if i * i > N:
        break
    e = 0
    while N % i == 0:
        e += 1
        N //= i
    if e > 0:
        for j in range(1, 10):
            if e >= j:
                e -= j
                ans += 1
            else:
                break
if N > 1:
    ans += 1

print(ans)

Solution (Python):
def divideprime(n):
    ret = []
    i = 2
    while i*i <= n:
        cnt = 0
        if(n%i != 0):
            i += 1
            continue
        
        while n % i == 0:
            cnt += 1
            n //= i
        
        ret.append([i,cnt])
        
        i += 1
    
    if n != 1:
        ret.append([n,1])
    
    return ret
    
N = int(input())

divp = divideprime(N)

ans = 0
for t in divp:
    cnt = 0
    e = 0
    s = set([])
    while (t[1]-e > 0) and (t[1]-e not in s):
        ans += 1
        cnt += 1
        e += cnt
        s.add(cnt)

print(ans)

Solution (Python):
def prime_factorize(n):
    '''
    素因数分解のリストを返す。n == 1のとき[]になるので注意。
    :param n:int
    素因数分解する自然数
    :return: list
    素因数分解した結果。

    例
    n : 10
    primes : [[2, 1], [5, 1]]
    '''
    primes = []
    for i in range(2, int(n ** (1 / 2)) + 1):
        if n % i != 0:
            continue
        num = 0
        while n % i == 0:
            num += 1
            n //= i
        primes.append([i, num])
    if n != 1:
        primes.append([n, 1])
    return primes

N = int(input())
prime_list = prime_factorize(N)
ans = 0
for _, e in prime_list:
    now = 1
    work = e
    while work >= now:
        work -= now
        now += 1
        ans += 1
print(ans)

Solution (Python):
import math
 
N = int(input())
 
M = int(math.sqrt(N))

ans = 0 
check = [True for _ in range(M + 1)]
e = [0 for _ in range(M + 1)]

for p in range(2, M + 1):
    if check[p] == True:
        for j in range(2, M // p + 1):
            check[p * j] = False

        while N % p == 0:
            N = N // p
            e[p] += 1
        
        ans += int((math.sqrt(1 + 8 * e[p]) - 1)/2)

if N > 1:
    ans += 1

print(ans)

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

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

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

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

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

    return arr

def p_num(m):
  ret = 0
  for j in range(1,10**12):
    ret += j
    if ret <= m < ret+(j+1):
      ans = j
      break
  return ans

p = factorization(N)

cnt = 0
for k in range(len(p)):
  cnt += p_num(p[k][1])
print(cnt)

Solution (Python):
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
    n = I()
    def prime_factor(n):
        lst = []
        while n%2 == 0:
            n //= 2
            lst.append(2)
        f = 3
        while f**2 <= n:
            if n%f == 0:
                n //= f
                lst.append(f)
            else:
                f += 2
        if n != 1:
            lst.append(n)
        return lst
    dic = collections.Counter(prime_factor(n))
    ans = 0

    for key,value in dic.items():
        cnt = 0
        while value>=cnt+1:
            cnt += 1
            value -= cnt

        ans += cnt
    
    print(ans)
        
main()

Solution (Python):
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
    n = I()
    dic = collections.defaultdict(int)

    while n != 1:
        prime = 0
        limit = int(n**(1/2))
        for i in range(2,limit+1):
            if n%i == 0:
                prime = i
                break
        else:
            prime = n

        while n%prime == 0:
            n //= prime
            dic[prime] += 1

    ans = 0

    for key,value in dic.items():
        cnt = 0
        while value>=cnt+1:
            cnt += 1
            value -= cnt

        ans += cnt
    
    print(ans)
        
main()

Solution (Python):
import math
N = int(input())
max_D = int(2 + math.sqrt(N))
count = []
ans = 1
for i in range(2, max_D):
   if N % i == 0:
      count.append(0)
      while N % i == 0:
         N = N // i
         count[-1] += 1
   if N < i:
      ans = 0
      break
l = len(count)
for i in range(l):
   E = 2*count[i]
   j = 0
   while j * (j + 1) <= E:
      j += 1
   ans += j - 1
print(ans)