qyliang/CodeNanoFix huggingface dataset:
Buggy code:
N = int(input())
ans = 0
n = N
counter = []
for i in range(2, int(N**0.5) + 1):
  if n % i == 0:
    counter.append(1)
    n = n // i
    while n % i == 0:
      counter[-1] += 1
      n = n // i
for c in counter:
  a = 1
  while c - a >= 0:
    c -= a
    a += 1
    ans += 1
print(1 if ans == 0 else ans)

Fixed code:
N = int(input())
ans = 0
n = N
counter = []
for i in range(2, int(N**0.5) + 2):
  if n % i == 0:
    counter.append(1)
    n = n // i
    while n % i == 0:
      counter[-1] += 1
      n = n // i
if n != 1:
  counter.append(1)
for c in counter:
  a = 1
  while c >= a:
    c -= a
    a += 1
    ans += 1
print(ans)
Buggy code:
from collections import Counter

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


N = int(input())
arr = dict(Counter(factorize(N)))
print(arr)
ans = 0
for v, c in arr.items():
    ans += 1
    z = 1
    for _ in range(2, c):
        z += z
        if c - z < 0:
            break
        ans += 1
print(ans)

Fixed code:
from collections import Counter

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


N = int(input())
arr = dict(Counter(factorize(N)))
ans = 0

for v, c in arr.items():
    count=0
    z = c
    for i in range(55):
        z -= i
        if z < 0:
            break
        count = i
    ans+=count
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())

arr = factorization(n) 
print(arr)

cnt = 0
for ar in arr:
    i = 1
    while 1:
        ar[1]-=i
        if ar[1] < 0:
            break
        cnt += 1
        i+=1
print(cnt)


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())
 
arr = factorization(n) 
# print(arr)
 
cnt = 0
if n == 1:
    pass
else:
    for ar in arr:
        i = 1
        while 1:
            ar[1]-=i
            if ar[1] < 0:
                break
            cnt += 1
            i+=1
print(cnt)
Buggy code:
import collections

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

N = int(input())
fact = prime_factorize(N)

b = []
q = 1
for p in fact:
    if p not in b:
        while fact.count(p) > q:
            for i in range (q):
                fact.remove(p)
            b.append(p ** q)
            #print(b)
            q += 1
    q = 1
    #print(p)

#print(b)
print(len(b))


Fixed code:
import collections

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

N = int(input())
fact = prime_factorize(N)

b = []
c = fact.copy()
q = 1
for p in fact:
    if p not in b:
        while c.count(p) >= q:
            for i in range (q):
                c.remove(p)
                #print(c)
            b.append(p ** q)
            #print(b)
            q += 1
    q = 1
    #print(p)
    #print(fact)

print(len(b))
Buggy code:
import numpy as np
n = int(input())

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
  
fact = factorization(n)
vals = []
for f in fact:
  for e in range(1, f[1]):
    vals.append(f[0]**e)
vals.sort()
if n==1:
  print(0)
else:
  ans = 0
  for d in vals:
    if n%d == 0:
      ans += 1
      n /= d
  print(ans)

Fixed code:
import numpy as np
n = int(input())

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
  
fact = factorization(n)
vals = []
for f in fact:
  for e in range(1, f[1]+1):
    vals.append(f[0]**e)
vals.sort()
if n==1:
  print(0)
else:
  ans = 0
  for d in vals:
    if n%d == 0:
      ans += 1
      n /= d
  print(ans)
Buggy code:
import bisect
import math
import sys
 
jd = []
for i in range(1,50) :
  jd.append((1+i)*i//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())
  
p = factorization(n)

ans = 0
for i in p :
  c = i[1]
  ans += bisect.bisect_right(jd, c)
  
print(ans)

Fixed code:
import bisect
import math
import sys
 
jd = []
for i in range(1,50) :
  jd.append((1+i)*i//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)
  sys.exit()

p = factorization(n)

ans = 0
for i in p :
  c = i[1]
  ans += bisect.bisect_right(jd, c)
  
print(ans)
Buggy code:
import math
N=int(input())
def hantei(u):
  if u==1:
    return 1
  for i in range(1,u+1):
    if (1/2)*i**2+(1/2)*i>u:
      return int(i-1)
    else:
      continue
   
a=[0]*int(N)
for i in range(2,N+1):
  while N%i==0:
    N=N//i
    a[i-1]=a[i-1]+1
c=0
for t in range(len(a)):
  if a[t]!=0:
    c+=hantei(a[t])
print(c)    

Fixed code:
import math
N=int(input())
def hantei(u):
  if u==1:
    return 1
  for i in range(1,u+1):
    if (1/2)*i**2+(1/2)*i>u:
      return int(i-1)
    else:
      continue
   
a=[0]*int(math.sqrt(N))
for i in range(2,int(math.sqrt(N))+1):
  while N%i==0:
    N=N//i
    a[i-1]=a[i-1]+1
c=0
if N!=1:
  c+=1
for t in range(len(a)):
  if a[t]!=0:
    c+=hantei(a[t])
print(c)
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

comb = factorization(n)
lst = []
for i in comb:
    for j in range(i[1]):
        lst.append(i[0]**(j+1))

lst.sort()
ans = 0
for i in lst:
    if n == 1:
        break
    elif n > 1:
        if n%i == 0:
            n = n/i
            print("n is ", n)
            ans += 1
print(ans)


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

comb = factorization(n)
lst = []
for i in comb:
    for j in range(i[1]):
        lst.append(i[0]**(j+1))

lst.sort()
ans = 0
for i in lst:
    if n == 1:
        break
    elif n > 1:
        if n%i == 0:
            n = n/i
            ans += 1
print(ans)
Buggy code:
import math
ans = 0
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

arr = factorization(int(input()))

for i in range(len(arr)):
    arfa = arr[i][1]
    ans += math.floor((-1+math.sqrt(1+8*arfa))/2)
print(ans)


Fixed code:
import math
import os
ans = 0
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())
arr = factorization(n)
if n==1:
    print(0)
    exit()

for i in range(len(arr)):
    arfa = arr[i][1]
    ans += math.floor((-1+math.sqrt(1+8*arfa))/2)
print(ans)
Buggy code:
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque

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

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

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

    return arr

n = int(stdin.readline().rstrip())
a = factorization(n)

m = 0
for b in a:
    bb = b[1]
    i = 1
    while True:
        if bb > 0:
            bb -= i
            i += 1
        else:
            break
    m = m + i - 1

print(m)

Fixed code:
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(math.sqrt(n)) + 2):
        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(stdin.readline().rstrip())
a = factorization(n)

m = 0
for b in a:
    bb = b[1]
    i = 0
    while True:
        bb -= i+1
        if bb >= 0:
            i += 1
        else:
            break
    m = m + i

if n != 1: print(m)
if n == 1: print(0)
Buggy code:
n = int(input())
ans = 0
d = 2

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

if n !=1:
    ans+=1

print(ans)

Fixed code:
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)
Buggy code:
n = int(input())
b = n
def pf(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 = list(set(pf(n)))
cnt = 0
for i in l:
    n = b
    t = 1
    j = i
    while i <= n:
        if n % i == 0:
            cnt += 1
            n = n // i
            a.append(i)
        i *= j
print(cnt)

Fixed code:
n = int(input())
b = n
def pf(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 = list(set(pf(n)))
cnt = 0
for i in l:
    n = b
    t = 1
    j = i
    while i <= n:
        if n % i == 0:
            cnt += 1
            n = n // i
        i *= j
print(cnt)
Buggy code:
import sys
from functools import lru_cache
 
#read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**6)
def read():
  return int(readline())
def reads():
  return map(int, readline().split())
def mp(arg):
  return map(int,arg.split())
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=read()
ls=factorization(n)
res=0
for num in ls:
    k=num[1]
    i=1
    while True:
        k-=i
        if k>=0:
            res+=1
        else:break
        i+=1
print(res)

Fixed code:
import sys
from functools import lru_cache
 
#read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**6)
def read():
  return int(readline())
def reads():
  return map(int, readline().split())
def mp(arg):
  return map(int,arg.split())
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=read()
ls=factorization(n)
res=0
#print(ls)
for num in ls:
    k=num[1]
    if num[0]==1:
      break
    i=1
    while True:
        k-=i
        if k>=0:
            res+=1
        else:break
        i+=1
print(res)
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 calcN(num):
    if num >= 45:
        return 9
    elif num >= 36:
        return 8
    elif num >= 28:
        return 7
    elif num >= 21:
        return 6
    elif num >= 15:
        return 5
    elif num >= 10:
        return 4
    elif num >= 6:
        return 3
    elif num >= 3:
        return 2
    elif num >= 1:
        return 1
    

A = int(input().split())
insuu =  factorization(A)
ret = 0
for i in insuu:
    ret += calcN(i[1])
print(ret)

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 calcN(num):
    if num >= 45:
        return 9
    elif num >= 36:
        return 8
    elif num >= 28:
        return 7
    elif num >= 21:
        return 6
    elif num >= 15:
        return 5
    elif num >= 10:
        return 4
    elif num >= 6:
        return 3
    elif num >= 3:
        return 2
    elif num >= 1:
        return 1
    

A = int(input())
if A == 1:
    print(0)
else:
    insuu =  factorization(A)
    ret = 0
    for i in insuu:
        ret += calcN(i[1])
    print(ret)
Buggy code:
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

c = collections.Counter(prime_factorize(N))
print(c)

ans=0
for i in c.values():
    tmp = i
    cnt=0
    val=1
    while True:
        tmp = tmp-val
        val+=1

        if tmp > 0:
            cnt+=1
        
        if tmp == 0:
            cnt+=1
            ans+=cnt
            break
        
        if tmp < 0:
            ans+=cnt
            break

print(ans)


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

c = collections.Counter(prime_factorize(N))

ans=0
for i in c.values():
    tmp = i
    cnt=0
    val=1
    while True:
        tmp = tmp-val
        val+=1

        if tmp > 0:
            cnt+=1
        
        if tmp == 0:
            cnt+=1
            ans+=cnt
            break
        
        if tmp < 0:
            ans+=cnt
            break

print(ans)
Buggy code:
#D
import math
N = int(input())
Nsyo = N
count = 0
div = 2
divcount = 0
divlist = []
while N > 1 and div <= math.sqrt(N):
    if N%div == 0:
        while N%div == 0:
            N = N/div
            divcount = divcount+1
        divlist.append(divcount)
        divcount = 0
    else:
        pass
    div = div + 1
div = 1
divcount = 0
for i in divlist:
    while i >= div:
        i = i-div
        divcount = divcount + 1
        div = div + 1
        
    count = count +divcount
    divcount = 0
    div = 1
if divlist == [] and N >0:
    count = 1
print(count)

Fixed code:
#D
import math
N = int(input())
Nsyo = N
count = 0
div = 2
divcount = 0
divlist = []
while N > 1 and div <= math.sqrt(Nsyo)+1:
    if N%div == 0:
        while N%div == 0:
            N = N/div
            divcount = divcount+1
        divlist.append(divcount)
        divcount = 0
    else:
        pass
    div = div + 1
div = 1
divcount = 0
for i in divlist:
    while i >= div:
        i = i-div
        divcount = divcount + 1
        div = div + 1
        
    count = count +divcount
    divcount = 0
    div = 1
if N > math.sqrt(Nsyo):
    count = count + 1
print(count)
Buggy code:
def main():
    import sys
    from math import log
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)
    N = int(input())
    prime = [True for i in range(int(N**.5)+1)]
    max_ = int(N ** .5) + 1
    ans = 0


    for p in range(2, max_):
        if not prime[p]:
            continue
        for q in range(p, max_, p):
            prime[q] = False
        if N % p != 0:
            continue
        # print('p = {}'.format(p))
        t = 1
        p_ = p
        while N % p_ == 0:
            t += 1
            p_ *= p
        if N % p_ > 0:
            t -= 1
        l, r = 0, 10 ** 6
        # print('t = {}'.format(t))
        while l + 1 < r:
            m = (l + r) // 2
            if m * (m + 1) // 2 <= t:
                l = m
            else:
                r = m
        # print('ans += {}'.format(l))
        ans += l
    if ans == 0:
        ans = 1
    print(ans)

if __name__ == '__main__':
    main()

Fixed code:
def main():
    import sys
    from math import log
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)
    N = int(input())
    prime = [True for i in range(int(N**.5)+2)]
    ans = 0
    if N == 1:
        print(0)
        exit()
    while True:
        # print('N = {}'.format(N))
        max_ = int(N ** .5) + 1
        for p in range(2, max_):
            if not prime[p]:
                continue
            for q in range(p, max_, p):
                prime[q] = False
            if N % p != 0:
                continue
            # print('p = {}'.format(p))
            t = 1
            p_ = p
            while N % p_ == 0:
                t += 1
                p_ *= p
            t -= 1
            l, r = 0, 10 ** 6
            # print('t = {}'.format(t))
            while l + 1 < r:
                m = (l + r) // 2
                if m * (m + 1) // 2 <= t:
                    l = m
                else:
                    r = m
            # print('ans += {}'.format(l))
            N //= (p ** t)
            ans += l
            break
        else:
            if N != 1:
                ans += 1
            break
    if ans == 0:
        ans = 1
    print(ans)

if __name__ == '__main__':
    main()
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())

P = factorization(N)

flag = 0

for i in range(len(P)):
  for j in range(40):
    P[i][1] = P[i][1] - (j + 1)
    if P[i][1] >= 0:
      flag += 1
    else:
      break
      
print(flag)

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

P = factorization(N)

flag = 0

for i in range(len(P)):
  for j in range(40):
    P[i][1] = P[i][1] - (j + 1)
    if P[i][1] >= 0:
      flag += 1
    else:
      break
if N == 1:
  print(0)
else:
  print(flag)
Buggy code:
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
  

c = collections.Counter(prime_factorize(N))

A = c.keys()
count = c.values()

ans = 0

for i in count:
  k = 0
  for j in range(1,i):
    k += j
    if k <= i:
      ans += 1
print(ans)

Fixed code:
N = int(input())

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
  

c = collections.Counter(prime_factorize(N))

A = c.keys()
count = c.values()

ans = 0

for i in count:
  k = 0
  for j in range(1,i+1):
    k += j
    if k <= i:
      ans += 1
      
print(ans)
Buggy code:
from sys import stdin
import math
def I(): return int(stdin.readline().rstrip())

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

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

print(ans)

Fixed code:
from sys import stdin
import math
def I(): return int(stdin.readline().rstrip())

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

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

print(ans)