qyliang/CodeNanoFix huggingface dataset:
Buggy code:
arr = []
temp = int(input())
for i in range(2, int(-(-temp**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)

def judge(n):
  l = 1
  while n > 0:
    n -= l
    l += 1
  if n == 0:
    return l-1
  else:
    return l-2

count = 0
for i in arr:
  count += judge(i)
print(count)

Fixed code:
arr = []
initial = int(input())
temp = initial
for i in range(2, int(-(-temp**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)

def judge(n):
  l = 1
  while n > 0:
    n -= l
    l += 1
  if n == 0:
    return l-1
  else:
    return l-2

count = 0
for i in arr:
  count += judge(i)

if initial == 1:
  print(0)
else:
  print(count)
Buggy code:
import itertools

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

#factorization(24) 

## [[2, 3], [3, 1]] 
##  24 = 2^3 * 3^1


t=int(input())
ans=0
x=factorization(t)


z=[i for i in range(51)]
z=list(itertools.accumulate(z))

for i in range(len(x)):
    cnt=x[i][1]
    for j in range(len(z)):
        if z[j]>cnt:
            ans+=j-1
            break

print(ans)

Fixed code:
import itertools

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

#factorization(24) 

## [[2, 3], [3, 1]] 
##  24 = 2^3 * 3^1


t=int(input())
if t==1:
  print(0)
  exit()
  
ans=0
x=factorization(t)


z=[i for i in range(51)]
z=list(itertools.accumulate(z))

for i in range(len(x)):
    cnt=x[i][1]
    for j in range(len(z)):
        if z[j]>cnt:
            ans+=j-1
            break

print(ans)
Buggy code:
from collections import Counter

def factors(n: int):
    l = [1]
    for i in range(2, int(n**0.5) + 1):
        #prime factorization
        while n % i == 0:
            n //= i
            l.append(i)
    if n > 1:
        l.append(n)
    return l

c = Counter(factors(int(input())))
ans = 0
for items,values in c.items():
    cnt = 1
    while cnt <= values:
        ans += 1
        cnt += 1
        values -= cnt
print(ans)


Fixed code:
from collections import Counter

def factors(n: int):
    l = []
    for i in range(2, int(n**0.5) + 1):
        #prime factorization
        while n % i == 0:
            n //= i
            l.append(i)
    if n > 1:
        l.append(n)
    return l

c = Counter(factors(int(input())))
ans = 0
for items,values in c.items():
    cnt = 1
    while cnt <= values:
        values -= cnt
        ans += 1
        cnt += 1
print(ans)
Buggy code:
import math

N = int(input())

p = 2
counter = 0
while N != 1:
 if p > math.sqrt(N): break
 ind = 0
 n = -1
 while N % p == 0:
  N //= p
  ind += 1
 if ind == 0:
  p += 1
  continue
 while (n+1)*(n+2)//2 <= ind:
  n += 1
 counter += n
 p += 1

counter += 1

print(counter)

Fixed code:
import math

N = int(input())

p = 2
counter = 0
while N != 1:
 if p > math.sqrt(N):
  counter += 1
  break
 ind = 0
 n = -1
 while N % p == 0:
  N //= p
  ind += 1
 if ind == 0:
  p += 1
  continue
 while (n+1)*(n+2)//2 <= ind:
  n += 1
 counter += n
 p += 1

print(counter)
Buggy code:
import math

def factorization(n):
    r = []
    temp = n
    for i in range(2,int(math.sqrt(n))+1):
        m = 0
        while temp % i == 0:
            temp /= i
            m += 1
        if m > 0:
            r.append((i,m))
    if temp != 1:
        r.append((temp,1))
    if len(r) == 0:
        r.append((n,1))
    return r

n = int(input())
p = factorization(n)
ans = 0
if p[0][0] == 1:
    ans = 0
else:
    for x in p:
        i = 1
        s = x[1]
        while s > 0:
            s -= i
            i += 1
        ans += (i-1)
print(ans)


Fixed code:
import math

def factorization(n):
    r = []
    temp = n
    for i in range(2,int(math.sqrt(n))+1):
        m = 0
        while temp % i == 0:
            temp /= i
            m += 1
        if m > 0:
            r.append((i,m))
    if temp != 1:
        r.append((temp,1))
    if len(r) == 0:
        r.append((n,1))
    return r

n = int(input())
p = factorization(n)
ans = 0
if p[0][0] == 1:
    ans = 0
else:
    for x in p:
        i = 1
        s = x[1]
        while s >= i:
            s -= i
            i += 1
        ans += (i-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

def count(m):
    count = 0
    for i in range(1, 10**12+1):
        if m >= i :
            m -= i
            count += 1
        else:
            return count


bun = factorization(n)

kazu = len(bun)

if kazu == 1 and bun[0][1] ==1:
    print(0)
    exit(0)


countup = 0
for i in range(kazu):
    countup += count(bun[i][1])

print(countup)

Fixed code:
n = int(input())

if n == 1:
    print(0)
    exit(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

def count(m):
    count = 0
    for i in range(1, 10**12+1):
        if m >= i :
            m -= i
            count += 1
        else:
            return count


bun = factorization(n)

kazu = len(bun)

#if kazu == 1 and bun[0][1] ==1:
#    print(0)
#    exit(0)


countup = 0
for i in range(kazu):
    countup += count(bun[i][1])

print(countup)
Buggy code:
import sys
import numpy as np


def input():
    return sys.stdin.readline()[:-1]

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

def func1(lst, value):
    return [i for i, x in enumerate(lst) if x <= value]


ans_ = np.array(factorization(N))
nums = []
index_list = []

ans = 0
for i in range(1, 100):
	ans += i
	index_list.append(ans)

for a in ans_:
	#nums.append(int(format(a[1], 'b')))
	nums.append(a[1])
	
ans = 0
for i in nums:
	index = func1(index_list, i)
	#print(max(index)+1)
	ans += max(index)+1
	
print(ans)


Fixed code:
import sys

def input():
    return sys.stdin.readline()[:-1]

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

def func1(lst, value):
    return [i for i, x in enumerate(lst) if x <= value]

if N == 1:
	print(0)
else:
	
	ans_ = factorization(N)
	nums = []
	index_list = []
	
	ans = 0
	for i in range(1, 100):
		ans += i
		index_list.append(ans)
		
	for a in ans_:
		#nums.append(int(format(a[1], 'b')))
		nums.append(a[1])
		
		#print(nums)
			
	ans = 0
	for i in nums:
		index = func1(index_list, i)
		#print(max(index)+1)
		ans += max(index)+1
	
	print(ans)
Buggy code:
n = int(input())

from collections import Counter

f = Counter()

for i in range(2, min(int(n ** 0.5 + 1), n + 1)):
  while n % i == 0:
    f[i] += 1
    n //= i

    
def bsearch(test, lo, hi):
  while lo != hi:
    mid = (lo + hi + 1) // 2
    if test(mid):
      lo = mid
    else:
      hi = mid - 1
  return lo

ans = 0
for p, q in f.items():
  ans += bsearch(lambda w: w * (w + 1) // 2 < q, 0, 10 ** 12) + 1

if ans == 0 and n > 1:
    print(1)
else:
    print(ans)


Fixed code:
n = int(input())
 
from collections import Counter
 
f = Counter()

factors = []
for i in range(2, min(int(n ** 0.5 + 1), n + 1)):
  if n % i == 0:
      factors.append(i)
      factors.append(n // i)

factors.sort()

for factor in factors:
    while n % factor == 0:
        n //= factor
        f[factor] += 1

 
    
def bsearch(test, lo, hi):
  while lo != hi:
    mid = (lo + hi + 1) // 2
    if test(mid):
      lo = mid
    else:
      hi = mid - 1
  return lo
 
ans = 0
for p, q in f.items():
  ans += bsearch(lambda w: w * (w + 1) // 2 <= q, 0, 10 ** 12)
 
if ans == 0 and n > 1:
    print(1)
else:
    print(ans)
Buggy code:
is_Prime = [True] * (10**6 + 1)
is_Prime[0] = False
is_Prime[1] = False
for i in range(2, int(10**3)+1):
    for j in range(2*i, 10**6+1, i):
        if j % i == 0:
            is_Prime[j] = False
P = [i for i in range(n+1) if is_Prime[i]]

N = int(input())
count = 0
for p in P:
    count_p = 0
    while N % p == 0:
        count_p += 1
        N /= p
    count += int((-1+(1+8*count_p)**(1/2))/2)
    if p == P[-1] and N != 1:
        count += 1
print(count)

Fixed code:
N = int(input())
n = min(N, 10**6)
is_Prime = [True] * (n + 1)
is_Prime[0] = False
is_Prime[1] = False
for i in range(2, int(n**(1/2)+1)):
    for j in range(2*i, n+1, i):
        if j % i == 0:
            is_Prime[j] = False
P = [i for i in range(n+1) if is_Prime[i]]

count = 0
for p in P:
    count_p = 0
    while N % p == 0:
        count_p += 1
        N /= p
    count += int((-1+(1+8*count_p)**(1/2))/2)
    if p == P[-1] and N != 1:
        count += 1
print(count)
Buggy code:
n = int(input())
r = 0
for p in range(2, int(n**0.5)+1):
    e = 0
    while n%p == 0:
       e += 1
       n /= p
    i = 1
    while e >= i:
        e -= i
        r += 1
        i += 1
print(r)

Fixed code:
n = int(input())
r = 0
for p in range(2, int(n**0.5)+1):
    e = 0
    while n%p == 0:
       e += 1
       n /= p
    i = 1
    while e >= i:
        e -= i
        r += 1
        i += 1
if n != 1:
    r += 1
print(r)
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 = 0
    for i in range(len(factorization(N))):
        tempnumber = factorization(N)[i][1]
        plusnumber = 1
        while tempnumber > 0:
            tempnumber -= plusnumber
            result += 1
            plusnumber += 1
    print(result)

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 = 0
    for i in range(len(factorization(N))):
        tempnumber = factorization(N)[i][1]
        plusnumber = 1
        while tempnumber > 0:
            result += 1
            plusnumber += 1
            tempnumber -= plusnumber
    print(result)
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


if __name__=="__main__":
    N = int(input())
    count = 0
    counter = collections.Counter(prime_factorize(N))
    output = 0
    for prime in counter:
        num_prime = 1
        count = 1
        while True:
            if counter[prime] >= wa:
                output += 1
                count += 1
                num_prime += count
            else:
                break
    print(output)

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


if __name__=="__main__":
    N = int(input())
    count = 0
    counter = collections.Counter(prime_factorize(N))
    output = 0
    for prime in counter:
        num_prime = 1
        count = 1
        while True:
            if counter[prime] >= num_prime:
                output += 1
                count += 1
                num_prime += count
            else:
                break
    print(output)
Buggy code:
import sys

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

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
prl = lambda x: print(*x ,sep='\n')

a = [i*(i+1) for i in range(60)]
n = ni()
l = factorization(n)
res = 0
for i in range(len(l)):
    j =  l[i][1]
    if l[i][0] == 1:
        continue
    for k,k_ in enumerate(a):
        if j < k_:
            res += k
            break
print(res)

Fixed code:
import sys

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

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
prl = lambda x: print(*x ,sep='\n')

a = [i*(i+1)//2 for i in range(60)]
n = ni()
l = factorization(n)
res = 0
for i in range(len(l)):
    j =  l[i][1]
    if l[i][0] == 1:
        continue
    for k,k_ in enumerate(a):
        if j < k_:
            res += k-1
            break
print(res)
Buggy code:
n=int(input())
b=[1,1,2,2,2,3,3,3,3,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,8,8,8,8,8]

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
a=factorization(n)
s=0
for i in range(len(a)):
    s+=b[a[i][1]-1]
print(s)

Fixed code:
n=int(input())
b=[1,1,2,2,2,3,3,3,3,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,8,8,8,8,8]

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
a=factorization(n)
s=0
if n==1:
    print(0)
else:
    for i in range(len(a)):
        s+=b[a[i][1]-1]
    print(s)
Buggy code:
import collections
N = int(input())
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
c = collections.Counter(pf(N))
print(c)
ans = 0
for i in c.keys():
    for j in range(1,40):
        if j*(j+1)/2 <= c[i] < (j+1)*(j+2)/2:
            ans += j
print(ans)

Fixed code:
import collections
N = int(input())
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
c = collections.Counter(pf(N))
ans = 0
for i in c.keys():
    for j in range(1,40):
        if j*(j+1)/2 <= c[i] < (j+1)*(j+2)/2:
            ans += j
print(ans)
Buggy code:
def get_prime_factorizations(n):
    """
    [summary]

    Parameters
    ----------
    n : int
        the number factorized by prime numbers.

    Returns
    -------
    dict[int: int]
        prime and exponent pair
        ex.) if n == 40, the function return  {2:3, 5:1} 
    """    
    root_n = int( n**(1/2) )
    primes = {2:0}
    primes.update({i:0 for i in range(3, root_n+1, 2)})
    for i in primes.keys():
        if n == 1:
            primes = {i: v for i, v in primes.items() if v > 0}
            return primes
        # count exponent
        exponent = 0
        while n % i == 0:
            n //= i
            exponent += 1
        # store the prime and exponent
        primes[i] = exponent

    primes = {i: v for i, v in primes.items() if v > 0}
    if len(primes) == 0:
        return {n: 1}
    return primes

n = int(input())
if n == 1:
    print(0)
else:
    primes =  get_prime_factorizations(n)
    print(primes)
    result = 0
    for exponent  in primes.values():
        count = 0
        while exponent - count > 0:
            count += 1
            exponent -= count
        result += count
    print(result)


Fixed code:
def get_prime_factorizations(n):
    """
    [summary]

    Parameters
    ----------
    n : int
        the number factorized by prime numbers.

    Returns
    -------
    dict[int: int]
        prime and exponent pair
        ex.) if n == 40, the function return  {2:3, 5:1} 
    """    
    root_n = int( n**(1/2) )
    primes = {2:0}
    primes.update({i:0 for i in range(3, root_n+1, 2)})
    for i in primes.keys():
        if n == 1:
            primes = {i: v for i, v in primes.items() if v > 0}
            return primes
        # count exponent
        exponent = 0
        while n % i == 0:
            n //= i
            exponent += 1
        # store the prime and exponent
        primes[i] = exponent

    primes = {i: v for i, v in primes.items() if v > 0}

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

    if len(primes) == 0:
        return {n: 1}
    return primes

n = int(input())
if n == 1:
    print(0)
else:
    primes =  get_prime_factorizations(n)
    result = 0
    for exponent  in primes.values():
        count = 0
        while exponent - count > 0:
            count += 1
            exponent -= count
        result += count
    print(result)
Buggy code:
n = int(input())
d = 2
ans = 0

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

if n != 1:
    ans += 1

print(ans)

Fixed code:
n = int(input())
d = 2
ans = 0

while d ** 2 <= 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:
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

t=int(input())
if t==1:
  print(0)
  exit()

fac=factorization(t)

def pcount(a):
  p=1
  cout=0
  while a>0:
    a=a-p
    p+=1
    if a<0:break
    cout+=1
  return cout

tt=0
for po in range(len(fac)):
  cc=pconut(po[i][1])
  tt+=cc

print(cc)

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
 
t=int(input())
if t==1:
  print(0)
  exit()
 
fac=factorization(t)
 
def pcount(a):
  p=1
  cout=0
  while a>0:
    a=a-p
    p+=1
    if a<0:break
    cout+=1
  return cout
#print(fac)
tt=0
 
for po in fac:
  
  cc=pcount(po[1])
  #print(cc)
  tt+=cc

print(tt)
Buggy code:
def task(n):
    primes = {}
    i = 2
    while i < 1000001 and i <= n:
        if n % i == 0:
            n = n // i
            if not i in primes:
                primes[i] = 0
            primes[i] += 1
        else:
            i += 1

    ans = 0
    for prime in primes:
        e = 1
        count = primes[prime]
        while count >= e:
            count -= e
            e += 1
            ans += 1

    if ans == 0:
        ans = 1

    print(ans)


n = int(input())
task(n)

Fixed code:
def task(n):
    if n == 1:
        print(0)
        return

    primes = {}
    i = 2
    while i < 1000001 and i <= n:
        if n % i == 0:
            n = n // i
            if not i in primes:
                primes[i] = 0
            primes[i] += 1
        else:
            i += 1

    # print(primes)
    ans = 0

    if n > 1:
        ans = 1

    for prime in primes:
        e = 1
        count = primes[prime]
        while count >= e:
            count -= e
            e += 1
            ans += 1

    print(ans)


n = int(input())
task(n)
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())
a=factorization(n)
ans=0
for i in range(len(a)):
  tmp=0
  for j in range(1,50):
    tmp+=j
    if a[i][1] >= tmp:
      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())
a=factorization(n)
ans=0
for i in range(len(a)):
  tmp=0
  for j in range(1,50):
    tmp+=j
    if a[i][1] >= tmp:
      ans += 1
if n==1:
  print(0)
else:
  print(ans)