qyliang/CodeNanoFix huggingface dataset:
Buggy code:
import math

n = int(input())
nroot = int(math.sqrt(n)) +1

result = {}

for i in range(2,nroot+1):
    while n%i==0:
        if i in result:
            result[i] +=1
        else:
            result[i] = 1
        
        n = n//i

ans = 0
for _, i in result.items():
    r = 0
    while  i >= 2 **r:
        i -= 2 ** r
        r +=1
    
        
    ans += r
if ans > 0:
    print(ans)
else:
    if n > 1:
        print(1)
    else:
        print(0)

Fixed code:
import math

n = int(input())
nroot = int(math.sqrt(n)) +1

result = {}

for i in range(2,nroot+1):
    while n%i==0:
        if i in result:
            result[i] +=1
        else:
            result[i] = 1
        
        n = n//i
if (n>nroot):
    result[n] = 1

ans = 0
for _, i in result.items():
    r = 1
    add = 0
    while  i >= r:
        i -=  r
        r +=1
        add +=1
    
        
    ans += add
if ans > 0:
    print(ans)
else:
    if n > 1:
        print(1)
    else:
        print(0)
Buggy code:

import numpy as np
from functools import *
import sys
sys.setrecursionlimit(100000)
input = sys.stdin.readline


import numpy as np

def acinput():
    return list(map(int, input().split(" ")))

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



s=factorize(float(input()))

res=0

for ss,n in s:
    tmp=np.floor((np.sqrt(8*n+1)-1)/2)
    print(tmp)
    res+=tmp

print(int(np.floor(res)))

Fixed code:

import numpy as np
from functools import *
import sys
sys.setrecursionlimit(100000)
input = sys.stdin.readline


import numpy as np

def acinput():
    return list(map(int, input().split(" ")))

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



s=factorize(float(input()))

res=0

for ss,n in s:
    tmp=np.floor((np.sqrt(8*n+1)-1)/2)
    #print(tmp)
    res+=tmp

print(int(np.floor(res)))

#print(s)
Buggy code:
from collections import deque


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

    if temp != 1:
        arr.append(1)

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

    return arr


n = int(input())
d = factorization(n)
d = deque(d)
count = 0
while d:
    m = 1
    a = d.popleft()
    while a >= m:
        a = a - m
        m += 1
        count += 1
print(count)


Fixed code:
from collections import deque


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

    if temp != 1:
        arr.append(1)

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

    return arr


n = int(input())
if n == 1:
    print(0)
    exit()
d = factorization(n)
d = deque(d)
count = 0
while d:
    m = 1
    a = d.popleft()
    while a >= m:
        a = a - m
        m += 1
        count += 1

print(count)
Buggy code:
import numpy as np
import math
import scipy as sp
import queue
import collections

MOD = 10 ** 9 + 7
INF = 10 ** 9

def main(kwargs):
    n = kwargs["n"]
    arr = factorization(n)

    res = 0

    for i in arr:
        res += sankaku(i[1])

    if n == 1:
        res = 0

    return res

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 sankaku(n):
    res = 1

    while True:
        n -= res

        if n <= 0:
            break

        res += 1

    return res

if __name__ == "__main__":
    kwargs = {}

    cin = input().split()
    kwargs["n"] = [int(i) for i in cin][0]

    cout = main(kwargs)
    print(cout)

Fixed code:
import numpy as np
import math
import scipy as sp
import queue
import collections

MOD = 10 ** 9 + 7
INF = 10 ** 9

def main(kwargs):
    n = kwargs["n"]
    arr = factorization(n)

    res = 0

    for i in arr:
        res += sankaku(i[1])

    if n == 1:
        res = 0

    return res

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 sankaku(n):
    res = 1

    while True:
        if res * (res + 1) // 2 <= n < (res + 1) * (res + 2) // 2:
            break

        res += 1

    return res

if __name__ == "__main__":
    kwargs = {}

    cin = input().split()
    kwargs["n"] = [int(i) for i in cin][0]

    cout = main(kwargs)
    print(cout)
Buggy code:
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 solve(N):
    fact = factorization(N)
    ans = 0

    if N == 1:
        print(-1)
        return

    for f in fact:
        s, c = f
        i = 1
        while True:
            if c >= i:
                c -= i
                ans += 1
            else:
                break
            i += 1
    print(ans)


if __name__ == '__main__':
    N = int(input())
    solve(N)


Fixed code:
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 solve(N):
    fact = factorization(N)
    ans = 0

    if N == 1:
        print(0)
        return

    for f in fact:
        s, c = f
        i = 1
        while True:
            if c >= i:
                c -= i
                ans += 1
            else:
                break
            i += 1
    print(ans)


if __name__ == '__main__':
    N = int(input())
    solve(N)
Buggy code:
N=int(input())
li=[0]*(10**6+1)
flag=False
for i in range(2,int(N**0.5)+1):
  while N%i==0:
    flag=True
    N/=i
    li[i]+=1
if flag==False:
  print(1)
  exit()
ans=0
for count in li:
  use=1
  while count-use>=0:
    ans+=1
    count-=use
    use+=1
print(ans)
    
    

Fixed code:
N=int(input())
fn=N
li=[0]*(10**6+100)
flag=False
if N==1:
  print(0)
  exit()
for i in range(2,int(N**0.5)+1):
  while N%i==0:
    flag=True
    N/=i
    li[i]+=1
if flag==False:
  print(1)
  exit()

ans=0
if N>fn**0.5:
  ans+=1
  
for count in li:
  use=1
  while count-use>=0:
    ans+=1
    count-=use
    use+=1
print(ans)
Buggy code:
#D
N=int(input())

P={}
for i in range(2,10**6+1):
    if N%i==0:
        P[i]=0
        while True:
            N=N/i
            P[i]+=1
            if N%i!=0:
                break
    if N==1:
        break
if P==1:
    print(0)
elif P=={}:
    print(N)
else:
    ans=0
    for key,v in P.items():
        z=key**v
        L=[0]+[True for i in range(v)]
        for i in range(1,v+1):
            if L[i]:
                if z%(key**i):
                    break
                z=z/(key**i)
                L[i]=False
                ans+=1
    print(ans)

Fixed code:
#D
N=int(input())
N_C=N
P={}
for i in range(2,10**6+1):
    if N%i==0:
        P[i]=0
        while True:
            N=N/i
            P[i]+=1
            if N%i!=0:
                break
    if N==1:
        break
if N_C==1:
    print(0)
elif P=={}:
    print(1)
else:
    ans=0
    for key,v in P.items():
        z=key**v
        L=[0]+[True for i in range(v)]
        for i in range(1,v+1):
            if L[i]:
                if z%(key**i):
                    break
                z=z/(key**i)
                L[i]=False
                ans+=1
    if N!=1:
        ans+=1
    print(ans)
Buggy code:
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

listA=factorization(N) 
nagasa=len(listA)
nn=0
kk=1
count=0
while nn<nagasa:
  while kk*(kk+1)/2 <=listA[nn][1]:
    count=count+1
    kk=kk+1
  kk=1
  nn=nn+1

print(count)


Fixed code:
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:  
 listA=factorization(N) 
 nagasa=len(listA)
 nn=0
 kk=1
 count=0
 while nn<nagasa:
   while kk*(kk+1)/2 <=listA[nn][1]:
     count=count+1
     kk=kk+1
   kk=1
   nn=nn+1
 print(count)
if N==1:
  print(0)
Buggy code:
import numpy as np

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

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

n = int(input())

ans = 0
z = 2

while True:
  if z > n:
    break
  if is_prime(n):
    ans += 1
    break
    
  if n % z != 0:
    z += 1
    continue
  
  tmp_divisors = make_divisors(z)
  for p in tmp_divisors[1:]:
    if not is_prime(p):
      continue
    tmp = np.log(z)/np.log(p)
    if tmp > 0 and tmp == int(tmp):
      n = n/z
      ans += 1
      z += 1
      break
  else:
    z += 1

print(ans)

Fixed code:
import numpy as np

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

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

n = int(input())

ans = 0
divisors = make_divisors(n)
for d in divisors[1:]:
  if d > n:
    break
  if is_prime(n):
    ans += 1
    break
    
  tmp_divisors = make_divisors(d)
  for p in tmp_divisors[1:]:
    if not is_prime(p):
      continue
    tmp = np.log(d)/np.log(p)
    if tmp > 0 and tmp == int(tmp) and n % d == 0:
      n = n/d
      ans += 1
      break

print(ans)
Buggy code:
import math
from collections import Counter
A= int(input())
resArray = []
tmpA = A
i = 1
while i <= math.sqrt(A):
    #print (i)
    i += 1
    if tmpA == 1:
        break

    if i >2 and i %2 == 0:
        continue


    while tmpA % i == 0:
        tmpA = tmpA / i
        resArray.append(i)

res = 0
if tmpA == A:
    print(1)
    exit()
else:
    res += 1


cArray = Counter(resArray)

for i in cArray.values():
    if i > 0:
        
        tmp = 1
        while tmp*(tmp+1)//2 <= i:
            tmp += 1
        res += tmp -1
print(res)

Fixed code:
import math
from collections import Counter
A= int(input())
if A == 1:
    print(0)
    exit()
resArray = []
tmpA = A
i = 1
while i <= math.sqrt(A):
    #print (i)
    i += 1
    if tmpA == 1:
        break

    if i >2 and i %2 == 0:
        continue


    while tmpA % i == 0:
        tmpA = tmpA / i
        resArray.append(i)

res = 0
if tmpA == A:
    print(1)
    exit()
elif tmpA > 1:
    res += 1


cArray = Counter(resArray)

for i in cArray.values():
    if i > 0:
        
        tmp = 1
        while tmp*(tmp+1)//2 <= i:
            tmp += 1
        res += tmp -1
print(res)
Buggy code:
import math
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

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

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

    return arr
N = int(input())
cnt = 0
insulist = factorization(N)
for i in range(len(insulist)):
  for j in range(1, insulist[i][1] + 1):
    if N % (insulist[i][0] ** j) == 0:
      N //= insulist[i][0] ** j
      cnt += 1
print(cnt)

Fixed code:
import math
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()
cnt = 0
insulist = factorization(N)
for i in range(len(insulist)):
  for j in range(1, insulist[i][1] + 1):
    if N % (insulist[i][0] ** j) == 0:
      N //= insulist[i][0] ** j
      cnt += 1
print(cnt)
Buggy code:
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
ans = 0

if(N>1):
    Q = factorization(N)
    "print(Q)"
    A = [ b for [a,b] in Q]
    for a in A:
        i = 1
        while(a >= i):
            a -= i
            i += 1
            ans += 1
    print(ans)

else:
    print(0)

Fixed code:
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
ans = 0

if(N>1):
    Q = factorization(N)
    A = [ b for [a,b] in Q]
    for a in A:
        i = 1
        while(a >= i):
            a -= i
            i += 1
            ans += 1
    print(ans)

else:
    print(0)
Buggy code:
from functools import lru_cache


def PrimeFactorization(m):
    pf = {}
    i = 2
    while i ** 2 < n:
        while n % i == 0:
            pf[i] = pf.get(i, 0) + 1
            n //= i
        i += 1
    if n > 1:
        pf[n] = 1
    return pf


@lru_cache(maxsize=100000)
def f(x):
    return int((-1 + (1 + 8 * x) ** 0.5) // 2 + 0.001)


def resolve():
    n = int(input())
    d = PrimeFactorization(n)
    ans = 0
    for v in d.values():
        ans += f(v)
    print(ans)


if __name__ == '__main__':
    resolve()


Fixed code:
from functools import lru_cache


def PrimeFactorization(m):
    pf = {}
    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
    return pf


@lru_cache(maxsize=100000)
def f(x):
    return int((-1 + (1 + 8 * x) ** 0.5) // 2 + 0.001)


def resolve():
    n = int(input())
    d = PrimeFactorization(n)
    ans = 0
    for v in d.values():
        ans += f(v)
    print(ans)


if __name__ == '__main__':
    resolve()
Buggy code:
import collections
import sys

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

Z = prime_factorize(N)

if not Z:
    print(0)
    sys.exit(0)

P = collections.Counter(Z)

print(P)

x = 0

for i in P.values():
    #print(i)
    y = 0
    z = 0
    for j in range(1, i+1):
        y = y + j
        z += 1
        print(i, y, z)
        if y >= i:
            if y > i:
                z -= 1
            break
    
    x = x + z

print(x)



Fixed code:
import collections
import sys

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

Z = prime_factorize(N)

if not Z:
    print(0)
    sys.exit(0)

P = collections.Counter(Z)

#print(P)

x = 0

for i in P.values():
    #print(i)
    y = 0
    z = 0
    for j in range(1, i+1):
        y = y + j
        z += 1
        #print(i, y, z)
        if y >= i:
            if y > i:
                z -= 1
            break
    
    x = x + z

print(x)
Buggy code:
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

f = factorization(n)
result = 0
for each in f:
    shisu = each[1]
    counter = 1
    while shisu >= counter:
        shisu -= counter
        counter += 1
        result += 1
print(result)

Fixed code:
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:
    print(0)
else:
    f = factorization(n)
    result = 0
    for each in f:
        shisu = each[1]
        counter = 1
        while shisu >= counter and shisu >= 0:
            shisu -= counter
            counter += 1
            result += 1
    print(result)
Buggy code:
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

num_group = [0]*11 #2**50 > 10**12  55=1+2+...+10
for i in range(10):
    num_group[i+1] = num_group[i] + (i+1)
#print(num_group)

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

Fixed code:
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 #2**50 > 10**12  55=1+2+...+10
for i in range(10):
    num_group[i+1] = num_group[i] + (i+1)
#print(num_group)

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)
Buggy code:
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
ans = 0
n = int(input())
f = [None for _ in range(40)]
f[1] = 1
for i in range(2, 40):
    if (f[i-1]+1)*(f[i-1]+2) == 2*i:
        f[i] = f[i-1]+1
    else:
        f[i] = f[i-1]

if n==1:
    print(0)
else:
    arr = factorization(n)
    for a,b in arr:
        ans += f[b]
print(ans)

Fixed code:
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
ans = 0
n = int(input())
f = [None for _ in range(40)]
f[1] = 1
for i in range(2, 40):
    if (f[i-1]+1)*(f[i-1]+2) == 2*i:
        f[i] = f[i-1]+1
    else:
        f[i] = f[i-1]   

if n==1:
    print(0)
else:
    arr = factorization(n)
    for a,b in arr:
        ans += f[b]
    print(ans)
Buggy code:
def main():
    n = int(input())
    def eratos(n):
        flag = [True] * (n + 1)
        for i in range(2, int(n**0.5) + 1):
            if flag[i]:
                for j in range(2*i, n + 1, i):
                    flag[j] = False
        return [i for i, x in enumerate(flag) if x and i >= 2]
    p = eratos(10**6)
    work = []
    for i in p:
        piyo = 0
        while n % i == 0:
            n //= i
            piyo += 1
        if piyo > 0:
            work.append(piyo)
        if n == 1:
            break
    if len(work) == 0:
        result = 1
    else:
        result = 0
        for i in work:
            for j in range(1, 10**6):
                i -= j
                if i <0:
                    break
                result += 1
    print(result)
main()


Fixed code:
def main():
    n = int(input())
    if n == 1:
        print(0)
        return
    def eratos(n):
        flag = [True] * (n + 1)
        for i in range(2, int(n**0.5) + 1):
            if flag[i]:
                for j in range(2*i, n + 1, i):
                    flag[j] = False
        return [i for i, x in enumerate(flag) if x and i >= 2]
    p = eratos(10**6)
    work = []
    for i in p:
        piyo = 0
        while n % i == 0:
            n //= i
            piyo += 1
        if piyo > 0:
            work.append(piyo)
        if n == 1:
            break
    if len(work) == 0:
        print(1)
        return
    else:
        result = 0
        for i in work:
            for j in range(1, 10**6):
                i -= j
                if i <0:
                    break
                result += 1
    if n != 1:
        result += 1
    print(result)
main()
Buggy code:
import math
n = int(input())
lis = []
for i in range(2,math.ceil(math.sqrt(n))+1):
    cnt = 0
    while n % i == 0:
        n //= i
        cnt += 1
    if cnt:lis.append(cnt)
ans = 0
for num in lis:
    go = 1
    while num >= go:
        ans += 1
        num -= go
        go += 1
print(ans)


Fixed code:
import math
n = int(input())
lis = []
for i in range(2,math.ceil(math.sqrt(n))+1):
    cnt = 0
    while n % i == 0:
        n //= i
        cnt += 1
    if cnt:lis.append(cnt)
if n != 1:
    lis.append(1)
ans = 0

if lis == []:
    if n == 1:
        print(0)
        exit()
    else:
        print(1)
        exit()
for num in lis:
    go = 1
    while num >= go:
        ans += 1
        num -= go
        go += 1
print(ans)