qyliang/CodeNanoFix huggingface dataset:
Buggy code:
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]


def prime_len(n):
    a = set()
    while n % 2 == 0:
        a.add(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.add(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.add(n)
    return len(a)


n = int(input())
c = 0
for z in make_divisors(n):
    if prime_len(z) == 1:
        tmp = n // z
        if tmp < 1:
            break
        n = tmp
        c += 1
print(c)


Fixed code:
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]


def prime_len(n):
    a = set()
    while n % 2 == 0:
        a.add(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.add(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.add(n)
    return len(a)


n = int(input())
c = 0
for z in make_divisors(n):
    if prime_len(z) == 1:
        tmp = n / z
        if tmp.is_integer():
            n = tmp
            c += 1
        else:
            continue

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

Fixed code:
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)
Buggy code:
a=int(input())
d=0
for i in range(2,int(a**0.5)+1):
    c=0
    while a%i==0:
        c+=1
        a//=i
    for i in range(1,60):
        if c>=i:
            c-=i
            d+=1
        else:
            break
    if a==1:
        break
print(d)

Fixed code:
a=int(input())
d=0
for i in range(2,int(a**0.5)+1):
    c=0
    while a%i==0:
        c+=1
        a//=i
    for i in range(1,60):
        if c>=i:
            c-=i
            d+=1
        else:
            break
    if a==1:
        break
if a!=1:
    d+=1
print(d)
Buggy code:
# -*- coding: utf-8 -*-
import collections
# factrize
def factorize(target_number):
    factor = 2
    factor_list = []
    while factor * factor <= target_number:
        while target_number % factor == 0:
            target_number //= factor
            factor_list.append(factor)
        factor = factor + 2
    if target_number > 1:
        factor_list.append(target_number)
    return factor_list

N = int(input())

fact_list = factorize(N)

fact_counter_dict = collections.Counter(fact_list)
ans = 0
for fact, freq in fact_counter_dict.items():
    freq_copy = freq
    for i in range(1, freq + 1):
        freq_copy -= i
        if freq_copy < 0:
            break
        ans += 1
print(ans)

Fixed code:
# -*- coding: utf-8 -*-
import collections
# factrize
def factorize(target_number):
    factor = 2
    factor_list = []
    while factor * factor <= target_number:
        while target_number % factor == 0:
            target_number //= factor
            factor_list.append(factor)
        factor = factor + 1
    if target_number > 1:
        factor_list.append(target_number)
    return factor_list

N = int(input())

fact_list = factorize(N)

fact_counter_dict = collections.Counter(fact_list)
ans = 0
for fact, freq in fact_counter_dict.items():
    freq_copy = freq
    for i in range(1, freq + 1):
        freq_copy -= i
        if freq_copy < 0:
            break
        ans += 1
print(ans)
Buggy code:

def fctr1(n):
    f = {}
    c = 0
    r = int(n**0.5)
    for i in range(2, r+2):
        while n % i == 0:
            c += 1
            n = n//i
        if c != 0:
            f[i] = c
            c = 0
    if n != 1:
        f[n] = 1
    return f


N = int(input())
p = fctr1(N)
ans = 0
for k, v in p.items():
    t = 0
    c = 0
    while (t+c+1) <= v:
        t += c
        c += 1
    ans += c
print(ans)


Fixed code:

def fctr1(n):
    f = {}
    c = 0
    r = int(n**0.5)
    for i in range(2, r+2):
        while n % i == 0:
            c += 1
            n = n//i
        if c != 0:
            f[i] = c
            c = 0
    if n != 1:
        f[n] = 1
    return f


N = int(input())
p = fctr1(N)
ans = 0
for k, v in p.items():
    c = 0
    while (v-c-1) >= 0:
        c += 1
        v -= c
    ans += c

print(ans)
Buggy code:
def func(N):
    tmp=N
    arr=[]
    for i in range(2,int(N**0.5+1)):
        if tmp%i==0:
            cnt=0
            while tmp%i==0:
                cnt+=1
                tmp//=i
            arr.append([i,cnt])
    if arr==[]:
        arr.append([tmp,1])
   
    return arr

N=int(input())
a=func(N)
ans=0
b=[1,3,6,10,15,21,28,36,45]
for i in a:
    for j in range(len(b)):
       if  i[1]<b[j]:
          ans+=j
          break
print(ans)

Fixed code:
def func(N):
    tmp=N
    arr=[]
    for i in range(2,int(-(-N**0.5//1))+1):
        if tmp%i==0:
            cnt=0
            while tmp%i==0:
                cnt+=1
                tmp//=i
            arr.append([i,cnt])
            
    if tmp!=1:
        arr.append([tmp, 1])
    if arr==[]:
        arr.append([tmp,1])
   
    return arr

N=int(input())
a=func(N)
ans=0
if a[0][0]==1:
        print(0)
        exit()
        
b=[1,3,6,10,15,21,28,36,45]
for i in a:
    for j in range(len(b)):
       if  i[1]<b[j]:
          ans+=j
          break
print(ans)
Buggy code:
def pfactor(n):
    result = []
    for i in range(2, int(n**0.5)+1):
        while n%i == 0:
            result.append(i)
            n //= i
    if result:
        return result
    else:
        return [n]


N = int(input())
factor = pfactor(N)
ans = 0

for p in set(factor):
    i = factor.count(p)
    while i > 0:
        c = (1 + 8*i) ** 0.5
        if c.is_integer():
            ans += (int(c)-1) // 2
            break
        i -= 1

print(ans)

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

  
N = int(input())
factor = pfactor(N)
ans = 0

for p in set(factor):
    i = factor.count(p)
    while i > 0:
        c = (1 + 8*i) ** 0.5
        if c.is_integer():
            ans += (int(c)-1) // 2
            break
        i -= 1

print(ans)
Buggy code:
import math


def prime_factors(n):
    count = {2: 0}

    while n % 2 == 0:
        n = n / 2
        count[2] += 1

    for i in range(3, int(math.sqrt(n))+1, 2):
        count[i] = 0
        while n % i == 0:
            n = n / i
            count[i] += 1

    if n > 2:
        if int(n) in count:
            count[int(n)] += 1
        else:
            count[int(n)] = 1
    print(count)
    ans = 0
    for k in count.values():
        if k:
            j = int(k**0.5)
            while j*(j+1) <= k:
                j += 1
            ans += j

    return ans


n = int(input())

print(prime_factors(n))


Fixed code:
import math


def prime_factors(n):
    count = {2: 0}

    while n % 2 == 0:
        n = n / 2
        count[2] += 1

    for i in range(3, int(math.sqrt(n))+1, 2):
        count[i] = 0
        while n % i == 0:
            n = n / i
            count[i] += 1

    if n > 2:
        if int(n) in count:
            count[int(n)] += 1
        else:
            count[int(n)] = 1
    # print(count)
    ans = 0
    for k in count.values():
        if k:
            j = int((2*k)**0.5)
            while j*(j+1) <= 2*k:
                j += 1
            ans += j-1

    return ans


n = int(input())

print(prime_factors(n))
Buggy code:
N = int(input())

def factorizatio(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
for i in factorizatio(N):
    cnt = i[1]
    a = 0
    for j in range(1, cnt+1):
        a += j            
        if a > cnt:
            break
        b += 1    
    ans += b

print(ans)

Fixed code:
N = int(input())

def factorizatio(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
for i in factorizatio(N):
    cnt = i[1]
    a = 0
    b = 0
    for j in range(1, cnt+1):
        a += j            
        if a > cnt:
            break
        b += 1    
    ans += b

print(0 if N == 1 else ans)
Buggy code:
from collections import Counter

N = int(input())

def prime(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 = Counter(prime(N))

ans = 0
for i in c.values():
    if i > 0:
        a = 0
        for j in range(1, cnt+1):
            a += j
            if a > cnt:
                break
            b += 1    
        ans += b

print(ans)

Fixed code:
from collections import Counter

N = int(input())

def prime(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 = Counter(prime(N))

ans = 0
for i in c.values():
    if i > 0:
        a = 0
        b = 0
        for j in range(1, i+1):
            a += j
            if a > i:
                break
            b += 1    
        ans += b

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
n = int(input())
x = factorization(n)
x.sort(key=lambda x: x[-1])
a = [0]
b = 0
for i in range(3,9):
    b += i
    a.append(b)
ans = 0
c = 1
for i in range(len(x)):
    if x[i][1] >= a[c]:
        c += 1
    ans += c
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
n = int(input())
x = factorization(n)
x.sort(key=lambda x: x[-1])
a = [0]
b = 3
for i in range(3,30):
    a.append(b)
    b += i
ans = 0
c = 1
for i in range(len(x)):
    for j in range(len(a)):
        if x[i][1] >= a[c]:
            c += 1
        else:
            break
    ans += c
if n == 1:
    print(0)
else:
    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




N = int(input())
sosuu = factorization(N)
#print(sosuu)
ans = 0

for partial in sosuu:
    #print(partial)
    partial_count = 0
    if partial[0] == 1:
        print(0)
        break
    for x in range(1,partial[1]+1):
        partial_count += x
        if partial_count > partial[1]:
            break
        ans += 1

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




N = int(input())
sosuu = factorization(N)
#print(sosuu)
ans = 0

for partial in sosuu:
    #print(partial)
    partial_count = 0
    if partial[0] == 1:
        #print(0)
        ans = 0
        break
    for x in range(1,partial[1]+1):
        partial_count += x
        if partial_count > partial[1]:
            break
        ans += 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

huga=[1,1]
for i in range(100):
  huga.append(huga[-1]+huga[-2])

n=int(input())
hoge=factorization(n)

ans=0
for i in range(len(hoge)):
  ans+=huga[hoge[i][1]-1]
  
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

huga=[1]
for i in range(100):
  huga.append(huga[-1]+i+2)
n=int(input())
hoge=factorization(n)
ans=0
for i in range(len(hoge)):
  for j in range(len(huga)):
    if(hoge[i][1]>=huga[j]):
      ans+=1
      
if(n==1):
  print(0)
else:
  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

N = int(input())
z_list = factorization(N)
Z = []
for z in z_list:
        for e in range(1, z[1]+1):
            Z.append(z[0]**e)
sorted(Z)
counter = 0 
for z in Z:
    if(N%z==0):
        N = N//z
        counter += 1
print(counter)



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

N = int(input())
z_list = factorization(N)
Z = []
for z in z_list:
        for e in range(1, z[1]+1):
            Z.append(z[0]**e)
sorted(Z)
counter = 0 
if N==1:
    print(0)
    quit()
for z in Z:
    if(N%z==0):
        N = N//z
        counter += 1
print(counter)
Buggy code:
import sys
sys.setrecursionlimit(100000)


def ins(): return input().split()
def ii(): return int(input())
def iil(): return list(map(int, ins()))
def lin(): return list(input())
def iin(): return map(int, ins())

from collections import defaultdict
from math import sqrt

arr = []
max_p = int(50000)
l1 = [1 for i in range(max_p)]
l2 = set()
l2.add(2)
for i in range(max_p):
    if not l1[i]:
        continue
    l2.add(2*i+3)
    for j in range(3*i+3, max_p, 2*i+3):
        l1[j] = 0

n = int(input())
dic = defaultdict(int)
for i in l2:
    while n % i == 0:
        n //= i
        dic[i] += 1
if n != 1:
    dic[n] += 1

ans = 0
for i in dic.values():
    ans += (-1 + sqrt(1 + 8 * i))//2
print(ans)


Fixed code:
import sys
sys.setrecursionlimit(100000)


def ins(): return input().split()
def ii(): return int(input())
def iil(): return list(map(int, ins()))
def lin(): return list(input())
def iin(): return map(int, ins())

from collections import defaultdict
from math import sqrt

arr = []
max_p = int(500000)
l1 = [1 for i in range(max_p)]
l2 = set()
l2.add(2)
for i in range(max_p):
    if not l1[i]:
        continue
    l2.add(2*i+3)
    for j in range(3*i+3, max_p, 2*i+3):
        l1[j] = 0

n = int(input())
#n = 10 ** 12
dic = defaultdict(int)
for i in l2:
    while n % i == 0:
        n //= i
        dic[i] += 1
if n != 1:
    dic[n] += 1

ans = 0
for i in dic.values():
    ans += (-1 + sqrt(1 + 8 * i))//2
print(int(ans))
Buggy code:
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())
    primes = Counter(get_prime_factors(n))
    ans = 0
    for k, v in primes.items():
        num = 1
        while v > 0:
            ans += 1
            v -= num
            num += 1
    print(ans)
    

if __name__ == "__main__":
    main()

Fixed code:
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
            ans += 1
            num += 1
    print(ans)
        

if __name__ == "__main__":
    main()
Buggy code:
def INT():
    return int(input())

def MI():
    return map(int, input().split())

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

from math import sqrt

N = INT()
tmp = N
fact = {}
is_prime = True

for n in range(2, int(sqrt(N)) + 1):
    if tmp == 1:
        break
    
    e = 0
    while 1:
        if tmp % n != 0:
            break
        tmp //= n
        e += 1
    
    if e == 0:
        continue

    fact[n] = e

if tmp != 1:
    
    fact[tmp] = 1

if fact == {}:
    fact[N] = 1

ans = 0

for p in fact.keys():
    e = 1
    z = p**e
    
    while 1:
        if N % z != 0:
            break
        N //= z
        e += 1
        z = pow(p, e)
        ans += 1
        
    if N == 1:
        break

print(ans)

Fixed code:
def INT():
    return int(input())

def MI():
    return map(int, input().split())

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

from math import sqrt

N = INT()
tmp = N
fact = {}
is_prime = True

for n in range(2, int(sqrt(N)) + 1):
    if tmp == 1:
        break
    
    e = 0
    while 1:
        if tmp % n != 0:
            break
        tmp //= n
        e += 1
    
    if e == 0:
        continue

    fact[n] = e

if tmp != 1:
    fact[tmp] = 1

if fact == {}:
    fact[N] = 1

ans = 0

for p in fact.keys():
    e = 1
    z = p
    
    if N == 1:
        break
    
    while 1:
        if N % z != 0:
            break
        N //= z
        e += 1
        z = pow(p, e)
        ans += 1
        
print(ans)
Buggy code:
from math import sqrt

n = int(input())

n_sqrt = int(sqrt(n))

dp = [-1] * (n_sqrt+1)

for i in range(2, n_sqrt+1):
    if dp[i] == -1:
        dp[i] = 1
        for j in range(i*2, n_sqrt+1, i):
            dp[j] = 0

prime = []

for i in range(2, n_sqrt+1):
    if dp[i] == 1:
        prime.append(i)

prime.append(n)

memo = []
for p in prime:
    cnt = 0
    while n%p==0:
        n //= p
        cnt += 1

    if cnt:
        memo.append(cnt)

ans = 0

for j in memo:
    k = 1
    while True:

        if k*(k+1)//2 <= j <= k*(k+3)//2:
            ans += k
            break
        k += 1

print(ans)

Fixed code:
from math import sqrt

n = int(input())

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

n_sqrt = int(sqrt(n))

dp = [-1] * (n_sqrt+2)

for i in range(2, n_sqrt+2):
    if dp[i] == -1:
        dp[i] = 1
        for j in range(i*2, n_sqrt+2, i):
            dp[j] = 0

prime = []

for i in range(2, n_sqrt+2):
    if dp[i] == 1:
        prime.append(i)

prime.append(n)

memo = []
for p in prime:
    cnt = 0
    while n%p==0:
        n //= p
        cnt += 1

    if cnt:
        memo.append(cnt)

if n > 1:
    memo.append(1)

ans = 0

for j in memo:
    k = 1
    while True:

        if k*(k+1)//2 <= j <= k*(k+3)//2:
            ans += k
            break
        k += 1

print(ans)
Buggy code:
def main():
  ## IMPORT MODULE
  #import sys
  from collections import Counter

  #sys.setrecursionlimit(100000)
  #input=lambda :sys.stdin.readline().rstrip()

  #f_inf=float("inf")
  #MOD=10**9+7
  
  if 'get_ipython' in globals(): 
    ## SAMPLE INPUT
    n = 64

  else:
    ##INPUT 
    n = input()
    #a, b = map(int, input().split())

  ## SUBMITION CODES HERE
  def prime_fact(n):
    P= []
    for i in range(2, int(n ** 0.5) + 1):
        while n % i == 0:
            P.append(i)
            n //= i
    if n != 1:
        P.append(n)
    return P

  cnt = Counter(prime_fact(n))

  ans = 0
  for c in cnt.values():
    tmp = 1
    while c >= tmp:
      c -= tmp
      ans += 1
      tmp += 1
    
  print(ans)
    
main()

Fixed code:
def main():
  ## IMPORT MODULE
  #import sys
  from collections import Counter

  #sys.setrecursionlimit(100000)
  #input=lambda :sys.stdin.readline().rstrip()

  #f_inf=float("inf")
  #MOD=10**9+7
  
  if 'get_ipython' in globals(): 
    ## SAMPLE INPUT
    n = 64

  else:
    ##INPUT 
    n =int(input())
    #a, b = map(int, input().split())

  ## SUBMITION CODES HERE
  def prime_fact(n):
    P = []
    for i in range(2, int(n ** 0.5) + 1):
        while n % i == 0:
            P.append(i)
            n //= i
    if n != 1:
        P.append(n)
    return P

  cnt = Counter(prime_fact(n))

  ans = 0
  for c in cnt.values():
    tmp = 1
    while c >= tmp:
      c -= tmp
      ans += 1
      tmp += 1
    
  print(ans)
    
main()
Buggy code:
import math
def eratos(n):
    isprime = [True for i in range(n+1)]
    isprime[0] = False
    isprime[1] = False
    for i in range(2, int(math.sqrt(n))+13):
        if isprime[i]:
            j = i + i
        while j <= n:
            isprime[j] = False
            j = j + i
    return isprime
N = int(input())
ans = 0
is_prime = eratos(10**6)
for i in range(2, 10**6+1):
    if not is_prime[i]:
        continue
    x = i
    while N % x == 0:
        ans += 1
        N //= x
        x += i
        # print(N)
if ans == 0 and N != 1:
    ans += 1
print(ans)

Fixed code:
import math
def eratos(n):
    isprime = [True for i in range(n+1)]
    isprime[0] = False
    isprime[1] = False
    for i in range(2, int(math.sqrt(n))+13):
        if isprime[i]:
            j = i + i
        while j <= n:
            isprime[j] = False
            j = j + i
    return isprime
N = int(input())
ans = 0
is_prime = eratos(10**6+13)
for i in range(2, 10**6+14):
    if not is_prime[i]:
        continue
    x = i
    while N % x == 0:
        ans += 1
        N //= x
        x *= i
        # print(N)
if ans == 0 and N != 1:
    ans += 1
elif N > 10**6:
    ans += 1
print(ans)