qyliang/CodeNanoFix huggingface dataset:
Buggy code:
N = int(input())
ans = 0
i = 2
N
l=2
flag=True
while(N**0.5>l):
    if N%l==0:
        flag=False
        break
    l+=1
if N ==1:
    ans = 0
elif flag:
    ans = 1
else:
    while(N**0.5>i):
        tmpi = i
        while(N%i==0):
            if N%tmpi==0:
                N/=tmpi
                tmpi*=i
                ans += 1
            else:
                N/=i
        i+=1
print(ans)

Fixed code:
N = int(input())
ans = 0
i = 2
N
l=2
flag=True
if N ==1:
    ans = 0
else:
    while(N**0.5>i):
        tmpi = i
        while(N%i==0):
            if N%tmpi==0:
                N/=tmpi
                tmpi*=i
                ans += 1
            else:
                N/=i
        i+=1
while(N**0.5>l):
    if N%l==0:
        flag=False
        break
    l+=1
if flag and N!=1:
    ans+=1
print(ans)
Buggy code:
def factorization(n):
    arr=[]
    tmp=n
    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(not arr):
        arr.append([1,1])
    if(tmp!=1):
        arr.append([tmp,1])
    return arr

N=int(input())
arr=factorization(N)
ans=0
for i in range(len(arr)):
    cnt=1
    while arr[i][1]>0:
        if arr[i][1]>=cnt:
            arr[i][1]-=cnt
            ans+=1
            cnt+=1
        else:
            break
print(ans)

Fixed code:
def factorization(n):
    arr=[]
    tmp=n
    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(not arr):
        arr.append([1,1])
    if(tmp!=1):
        arr.append([tmp,1])
    return arr

N=int(input())
if N==1:
    print(0)
    exit()
arr=factorization(N)
ans=0
for i in range(len(arr)):
    if arr[i][0]==1:
        continue
    cnt=1
    while arr[i][1]>0:
        if arr[i][1]>=cnt:
            arr[i][1]-=cnt
            ans+=1
            cnt+=1
        else:
            break
print(ans)
Buggy code:
import math
n = int(input())

#Prime factoring
pf = []
for i in range(2,math.ceil(n**0.5)+1):
    temp = 0
    while n%i==0:
        n /= i
        temp += 1
    if temp:
        pf.append(temp)
    if n==1:
        break
if not pf:
    pf.append(1)

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

Fixed code:
import math
n = int(input())

#Prime factoring
pf = []
for i in range(2,math.ceil(n**0.5)+1):
    temp = 0
    while n%i==0:
        n /= i
        temp += 1
    if temp:
        pf.append(temp)
    if n==1:
        break
if n!=1:
    pf.append(1)

ans =  0
for i in range(len(pf)):
    j = 1
    while pf[i]-j>=0:
        ans += 1
        pf[i] -= j
        j += 1
print(ans)
Buggy code:
import math

def append_factors(n, f, p):
    num_factors = 0
    while n % p == 0:
        num_factors += 1
        n //= p
    if num_factors != 0:
        f[p] = num_factors
    return n

def factors(n):
    l = int(math.sqrt(n)) + 1
    ret = {}
    n = append_factors(n, ret, 2)
    n = append_factors(n, ret, 3)
    i = 6
    while i*i <= n + 1:
        p1, p2 = i - 1, i + 1
        n = append_factors(n, ret, i - 1)
        n = append_factors(n, ret, i + 1)
        i += 6
    if n != 1:
        append_factor(ret, n)

    return ret

def minimum_sum(x):
    # find the minimum integer n where n(n+1)/2 <= x
    # n^2 < n(n+1) <= 2x < (n+1)(n+2) < (n+2)^2

    n = int(math.sqrt(x))
    while (n + 1)*(n + 2) <= 2*x:
        n += 1

    return n

def main():
    N = int(input())
    fs = factors(N)
    # print(fs)
    ans = 0
    for f in fs:
        ans += minimum_sum(fs[f])
    print(ans)

if __name__ == '__main__':
    main()


Fixed code:
import math

def append_factors(n, f, p):
    num_factors = 0
    while n % p == 0:
        num_factors += 1
        n //= p
    if num_factors != 0:
        f[p] = num_factors
    return n

def factors(n):
    ret = {}
    n = append_factors(n, ret, 2)
    n = append_factors(n, ret, 3)
    i = 6
    while i*i <= n + 1:
        p1, p2 = i - 1, i + 1
        n = append_factors(n, ret, i - 1)
        n = append_factors(n, ret, i + 1)
        i += 6
    if n != 1:
        ret[n] = 1

    return ret

def minimum_sum(x):
    # find the minimum integer n where n(n+1)/2 <= x
    # n(n+1) <= 2x < (n+1)(n+2)

    n = int(math.sqrt(2 * x))
    while n*(n + 1) > 2*x:
        n -= 1

    return n

def main():
    N = int(input())
    fs = factors(N)
    # print(fs)
    ans = 0
    for f in fs:
        ans += minimum_sum(fs[f])
    print(ans)

if __name__ == '__main__':
    main()
Buggy code:
def append_factor(f, p):
    if p not in f:
        f[p] = 0
    f[p] += 1

def factors(n):
    l = int(math.sqrt(n)) + 1
    ret = {}
    while n % 2 == 0:
        append_factor(ret, 2)
        n //= 2
    while n % 3 == 0:
        append_factor(ret, 3)
        n //= 3
    i = 6
    while i*i <= n:
        while n % (i - 1) == 0:
            append_factor(ret, i - 1)
            n //= (i - 1)
        while n % (i + 1) == 0:
            append_factor(ret, i + 1)
            n //= (i + 1)
        i += 6
    if n != 1:
        append_factor(ret, n)

    return ret

def minimum_sum(x):
    # find the minimum integer n where n(n+1)/2 <= x
    # n^2 < n(n+1) <= 2x < (n+1)(n+2) < (n+2)^2

    n = int(math.sqrt(x))
    while (n + 1)*(n + 2) <= 2*x:
        n += 1

    return n

def main():
    N = int(input())
    fs = factors(N)
    # print(fs)
    ans = 0
    for f in fs:
        ans += minimum_sum(fs[f])
    print(ans)

if __name__ == '__main__':
    main()


Fixed code:
import math

def append_factor(f, p):
    if p not in f:
        f[p] = 0
    f[p] += 1

def factors(n):
    l = int(math.sqrt(n)) + 1
    ret = {}
    while n % 2 == 0:
        append_factor(ret, 2)
        n //= 2
    while n % 3 == 0:
        append_factor(ret, 3)
        n //= 3
    for i in range(6, l, 6):
        while n % (i - 1) == 0:
            append_factor(ret, i - 1)
            n //= (i - 1)
        while n % (i + 1) == 0:
            append_factor(ret, i + 1)
            n //= (i + 1)
    if n != 1:
        append_factor(ret, n)

    return ret

def minimum_sum(x):
    # find the minimum integer n where n(n+1)/2 <= x
    # n^2 < n(n+1) <= 2x < (n+1)(n+2) < (n+2)^2

    n = int(math.sqrt(x))
    while (n + 1)*(n + 2) <= 2*x:
        n += 1

    return n

def main():
    N = int(input())
    fs = factors(N)
    # print(fs)
    ans = 0
    for f in fs:
        ans += minimum_sum(fs[f])
    print(ans)

if __name__ == '__main__':
    main()
Buggy code:
import math
def main():

    N = int(input())
    primes = []
    def isprime(n):
        if n == 1: return False
        for i in range(2, int(math.sqrt(n))+1):
            if n % i == 0:
                return False
        return True

    primes = set()
    for i in range(1, int(math.sqrt(N))+1):
        if isprime(i):
            primes.add(i)
    if isprime(N):
        primes.add(N)
    # print(primes)

    ans = 0
    for p in primes:
        q = p
        while N % q == 0:
            ans += 1
            N //= q
            q *= p
    return ans


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

Fixed code:
import math
def main():

    N = int(input())
    primes = []
    def isprime(n):
        if n == 1: return False
        for i in range(2, int(math.sqrt(n))+1):
            if n % i == 0:
                return False
        return True

    primes = set()
    for i in range(1, int(math.sqrt(N))+1):
        if N % i == 0:
            if isprime(i):
                primes.add(i)
            if isprime(N//i):
                primes.add(N//i)
    if isprime(N):
        primes.add(N)

    ans = 0
    for p in primes:
        q = p
        while N % q == 0:
            ans += 1
            N //= q
            q *= p
        if N == 1:
            break
    return ans


if __name__ == '__main__':
    print(main())
Buggy code:
import collections

N=int(input())
ans=0

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)
	
else:
	lis=collections.Counter(prime_factorize(N))
	lis_=list(lis.values())
	for i in range(len(lis_)):
		for h in range(1,45):
			if lis_[i]>=h*(h+1)/2:
				ans+=1

Fixed code:
import collections

N=int(input())
ans=0

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)
	
else:
	lis=collections.Counter(prime_factorize(N))
	lis_=list(lis.values())
	for i in range(len(lis_)):
		for h in range(1,45):
			if lis_[i]>=h*(h+1)/2:
				ans+=1
	print(int(ans))
Buggy code:
from math import sqrt

n = int(input())

i = 2
j = 0
c = []

while n != 1:
    
    if n%i == 0:
        j += 1
        n = n/i
        if n == 1:
            c.append(j)
    else:
        if j != 0:
            c.append(j)
        i += 1
        j = 0
        
d = 0        
if c == []:
    print(d)
else:
    for k in c:
        d += int((sqrt(1 + 8*k)-1)/2)
    print(d)
            

Fixed code:
from math import sqrt

n = int(input())

i = 2

c = []

while i*i <= n:
    j = 0
    while n%i == 0:
        j += 1
        n //= i   
    else:
        if j != 0:
            c.append(j)
    i += 1
if n > 1:
    c.append(1)
             
d = 0        
if c == []:
    print(d)
else:
    for k in c:
        d += int((sqrt(1 + 8*k)-1)/2)
    print(d)
Buggy code:
from collections import defaultdict
import decimal
import sys
input = sys.stdin.readline


def prime_factor_count(n):
    def count(n, i):
        cnt = 0
        while n % i == 0:
            cnt += 1
            n //= i
        return n, cnt

    d = {}
    if n == 1:
        return d

    n, cnt = count(n, 2)
    d[2] = cnt
    print(d, n)

    lst = [2]
    for num in range(3, int(n ** 0.5) + 1, 2):
        if n == 1:
            break
        for p_num in lst:
            if num % p_num == 0:
                break
            elif p_num * p_num > num:
                lst.append(num)
                n, cnt = count(n, num)
                d[num] = cnt
                break
    else:
        if n != 1:
            d[n] = 1
    return d



def main():
    n = int(input())
    d = prime_factor_count(n)

    cnt = 0
    tmp_n = 0
    for k, v in d.items():
        exp_cnt = 1
        while 1:
            if exp_cnt > v:
                break
            else:
                if tmp_n % (tmp_exp := k ** exp_cnt) == 0:
                    tmp_n //= tmp_exp
                    cnt += 1
                    v -= exp_cnt
                    exp_cnt += 1
    else:
        if n == tmp_n:
            cnt += 1
    print(cnt)


if __name__ == '__main__':
    main()


Fixed code:
from collections import defaultdict
import decimal
import sys
input = sys.stdin.readline


def prime_factor_count(n):
    def count(n, i):
        cnt = 0
        while n % i == 0:
            cnt += 1
            n //= i
        return n, cnt

    d = {}
    if n == 1:
        return d

    n, cnt = count(n, 2)
    d[2] = cnt

    lst = [2]
    for num in range(3, int(n ** 0.5) + 1, 2):
        if n == 1:
            break
        for p_num in lst:
            if num % p_num == 0:
                break
            elif p_num * p_num > num:
                lst.append(num)
                n, cnt = count(n, num)
                d[num] = cnt
                break
    else:
        if n != 1:
            d[n] = 1
    return d



def main():
    n = int(input())
    d = prime_factor_count(n)

    cnt = 0
    tmp_n = 0
    for k, v in d.items():
        exp_cnt = 1
        while 1:
            if exp_cnt > v:
                break
            else:
                if tmp_n % (tmp_exp := k ** exp_cnt) == 0:
                    tmp_n //= tmp_exp
                    cnt += 1
                    v -= exp_cnt
                    exp_cnt += 1
    else:
        if n == tmp_n:
            cnt += 1
    print(cnt)


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

def p(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())
s = p(n)
c = collections.Counter(s)
t = list(c.values())
m = 0

for i in range(len(t)):
    for j in range (100):
        if (t[i]- 1 >= 0):
            m = m + 1
            t[i] = t[i] - 1
        else:
            break

print(m)

Fixed code:
import collections

def p(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())
s = p(n)
c = collections.Counter(s)
t = list(c.values())
m = 0

for x in t:
    
    a = 1

    for j in range (100):
        if (x - a >= 0):
            x = x - a
            m = m + 1
            a = a + 1
        else:
            break

print(m)
Buggy code:

n=int(input())

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

soinsu = factorization(n)
a = len(soinsu)
ans = 0

for i in range(a):
    x = soinsu[i][1]
    for j in range(1,10**18):
        if x >= j:
            x = x-j
            ans += 1
        else:
            break

if ans == 0 and n!= 1:
    ans = 1

print (ans)



Fixed code:
n=int(input())

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

soinsu = factorization(n)
a = len(soinsu)
#print(soinsu)
#print(a)
ans = 0

for i in range(a):
    x = soinsu[i][1]
    for j in range(1,10**18):
        if x >= j:
            x = x-j
            ans += 1
        else:
            break

if n== 1:
    ans = 0


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)
trial_list = []
for p in arr:
  i = p[0]
  j = p[1]
  for k in range(1,j+1):
  	trial_list.append(i**k)
sorted(trial_list)
cnt=0
for i in trial_list:
  if n%i==0:
    cnt+=1
    n//=i
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())
if n==1:
  print(0)
else:
  arr = factorization(n)
  trial_list = []
  for p in arr:
    i = p[0]
    j = p[1]
    for k in range(1,j+1):
      trial_list.append(i**k)
  sorted(trial_list)
  cnt=0
  for i in trial_list:
    if n%i==0:
      cnt+=1
      n//=i
  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(cnt)
  if temp!=1:
    arr.append(1)
  if n==1:
    arr.append(0)
  return arr
def kak(n):
  return ((1+8*n)**(1/2)-1)//2
  
A=dactorization(int(input()))
print(sum([kak(i) for i in A]))

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(cnt)
  if temp!=1:
    arr.append(1)
  if n==1:
    arr.append(0)
  return arr
def kak(n):
  return ((1+8*n)**(1/2)-1)//2
  
A=factorization(int(input()))
print(int(sum([kak(i) for i in A])))
Buggy code:
from math import sqrt
pf={}
m=int(input())
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
#print(pf)

cnt = 0
calc = lambda n: (sqrt(8 * n + 1) - 1) // 2
for i in pf:
    n = 1
    while i >= n:
        i -= n
        cnt += 1
        n += 1
#    cnt += calc(pf[i])
print(int(cnt))



Fixed code:
from math import sqrt
pf={}
m=int(input())
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
#print(pf)

cnt = 0
calc = lambda n: (sqrt(8 * n + 1) - 1) // 2
for i in pf:
    cnt += calc(pf[i])
print(int(cnt))
Buggy code:
import math
def D():
    N = int(input())
    if N == 1:
        print(0)
        return
    temp = N
    count = 0
    while temp % 2 == 0: 
       temp //= 2
       count += 1
    track = 1
    # print(count)
    while count-track >= 0:
        count -= track
        track += 1
    # print(temp, track-1)
    ans = max(0, track-1)
    for i in range(3,int(math.sqrt(N))+1,2): 
        count = 0
        while temp % i== 0: 
            temp //= i
            count += 1
        track = 1
        while count-track >= 0:
            count -= track
            track += 1
        ans += max(0, track - 1)
    print(ans)

D()

Fixed code:
import math
def D():
    N = int(input())
    if N == 1:
        print(0)
        return
    temp = N
    count = 0
    while temp % 2 == 0: 
       temp //= 2
       count += 1
    track = 1
    # print(count)
    while count-track >= 0:
        count -= track
        track += 1
    # print(temp, track-1)
    ans = track - 1
    for i in range(3,int(math.sqrt(temp))+1,2): 
        count = 0
        while temp % i== 0: 
            temp //= i
            count += 1
        track = 1
        while count-track >= 0:
            count -= track
            track += 1
        ans += track - 1
    if temp > 2:
        ans += 1
    print(ans)
D()
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

if n == 1:
    print(0)
    quit()
f = factorization(n)
print(f)
ans = 0
c = len(f)
for i in range(c):
    s = 0
    g = f[i][1]
    if g == 2:
        ans += 1
    else:
        for j in range(g):
            s += j + 1
            f[i][1] -= j+1
            ans += 1
            if s >= g:
                break
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

if n == 1:
    print(0)
    quit()
f = factorization(n)
ans = 0
c = len(f)
for i in range(c):
    s = 0
    g = f[i][1]
    if g == 2:
        ans += 1
    else:
        for j in range(g):
            s += j + 1
            f[i][1] -= j+1
            if s > g:
                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

n=int(input())

if n==1:
    print(0)
else:
    result=factorization(n)
    primes=len(result)

    ans=0
    for i in range(primes):
        tmp=result[i][1]
        cnt=0
        j=1
        while tmp>0:
            tmp-=j
            cnt+=1
            j+=1
        
        ans+=cnt

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

if n==1:
    print(0)
else:
    result=factorization(n)
    primes=len(result)
    
    ans=0
    for i in range(primes):
        tmp=result[i][1]
        cnt=0
        j=1
        while 1:
            tmp-=j
            if tmp>=0:
                cnt+=1
            else:
                break
            j+=1
        
        ans+=cnt

    print(ans)
Buggy code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.buffer.readline().rstrip()
rs = lambda: sys.stdin.buffer.readline().split()
ri = lambda: int(sys.stdin.buffer.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.buffer.readline().split()))

n = ri()
ans = 0
d = 2
while d**2 <= n:
    dd = d
    while n % d == 0:
        n //= d
        print(n, d, ans)
        d **= 2
        ans += 1
    while n % dd == 0:
        n //= dd
    d = dd + 1
if n != 1:
    ans += 1
print(ans)



Fixed code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.buffer.readline().rstrip()
rs = lambda: sys.stdin.buffer.readline().split()
ri = lambda: int(sys.stdin.buffer.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.buffer.readline().split()))

n = ri()
ans = 0
d = 2
while d**2 <= n:
    if n % d != 0:
        d += 1
        continue

    dd = d
    while n % d == 0:
        n //= d
        d *= dd
        ans += 1

    while n % dd == 0:
        n //= dd
    d = dd + 1

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

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

    return arr
N = int(input())
ans = 0
if N != 1:
    fact_list = factorization(N)
    for _, i in fact_list:
        j = 1
        while i >= j:
            ans += 1
            i = i - j
            j += 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())
ans = 0
if N != 1:
    fact_list = factorization(N)
    for _, i in fact_list:
        j = 1
        while i >= j:
            ans += 1
            i = i - j
            j += 1
            
print(ans)