qyliang/CodeNanoFix huggingface dataset:
Buggy code:
from collections import Counter
import math
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

s=dict(Counter(prime_factorize(n)))
#print(s)
sum_ans=0
for i in s.values():
  
  if i==1:
    sum_ans+=1
    
  else:
    k=1
    while i:
      i-=k
      k+=1
      #print(i)
      sum_ans+=1
      
print(sum_ans)
      

Fixed code:
from collections import Counter
import math
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

s=dict(Counter(prime_factorize(n)))
#print(s)
sum_ans=0
for i in s.values():
  
  if i==1:
    sum_ans+=1
    
  else:
    k=1
    while i>0:
      i-=k
      k+=1
      #print(i)
      if i<0:
        break
      sum_ans+=1
      
print(sum_ans)
Buggy code:
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
  
from collections import Counter
n=int(input())
s=Counter(prime_factorize(n))
t=list(s.values())
cnt=0
#print(s)
#print(t)
for i in t:
  if i==1:
    cnt+=1
    
  else:
    s=1
    while i>0:
      i=i-s
      s+=1
      cnt+=1
      
print(cnt)
      

Fixed code:
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
  
from collections import Counter
n=int(input())
s=Counter(prime_factorize(n))
t=list(s.values())
cnt=0
#print(s)
#print(t)
for i in t:
  if i==1:
    cnt+=1
    
  else:
    s=1
    while i>0:
      i=i-s
      s+=1
      if i<0:
        break
      cnt+=1
      
print(cnt)
Buggy code:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
 
    if temp!=1:
        arr.append([temp, 1])
 
    if arr==[]:
        arr.append([n, 1])
 
    return arr
 
import sys     
N = int(input())
if N == 1:
    print(0)
    sys.exit()

fact = factorization(N)
fact_num = []
fact_num2 = []
 

for i in range(len(fact)):
    fact_num.append(fact[i][0])
    fact_num2.append(fact[i][1])

cnt=0

for j in range(1000000000000):
    for i in range(len(fact)):
        if N%fact_num[i]==0 and N%(fact_num[i]*(j+1))==0:
            N = N/(fact_num[i]*(j+1))
            cnt+=1
            if N==1:
                print(cnt)
                sys.exit()
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
 
import sys     
N = int(input())
if N == 1:
    print(0)
    sys.exit()

fact = factorization(N)
fact_num = []
fact_num2 = []
 

for i in range(len(fact)):
    fact_num.append(fact[i][0])
    fact_num2.append(fact[i][1])

cnt=0

for j in range(max(fact_num2)+1):
    for i in range(len(fact)):
        if N%fact_num[i]==0 and N%(fact_num[i]**(j+1))==0:
            N = N/(fact_num[i]**(j+1))
            cnt+=1

            if N==1:
                print(cnt)
                sys.exit()
print(cnt)
Buggy code:
from itertools import groupby
n =int(input())

def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n%i == 0:
      n //= i
      table.append(i)
      i += 1
  if n > 1:
    table.append(n)
  return table

from itertools import groupby
ans = 0
p = prime_decomposition(n)
for k,g in p:
  gn = len(list(g))
  for i in range(1,1000000000000):
    gn -= i
    if gn >= 0:
      ans += 1
    else:
      break
print(ans)

Fixed code:
from itertools import groupby
n =int(input())

def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n%i == 0:
      n //= i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table

from itertools import groupby
ans = 0
p = prime_decomposition(n)
for k,g in groupby(p):
  gn = len(list(g))
  for i in range(1,1000000):
    gn -= i
    if gn >= 0:
      ans += 1
    else:
      break
print(ans)
Buggy code:
def fac(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append(cnt)

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

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

    return arr

n=int(input())
li=fac(n)

ans=0
y=0
for x in range(1,10):
    y=y+x
    ans=ans+len([i for i in li if i >= y])
print(ans)

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

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

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

n=int(input())
li=fac(n)

ans=0
y=0
if n==1:
    ans=0
else:
    for x in range(1,1000):
        y=y+x
        ans=ans+len([i for i in li if i >= y])
        if len([i for i in li if i >= y])==0:
            break
print(ans)
Buggy code:
import math

N=int(input())

ans=0
arr=[]

tmp=1

print(int(math.sqrt(N))+5)

for i in range(int(math.sqrt(N))+5):
    tmp=1

    while N % ((i+2)**tmp) == 0:
        N=N // ((i+2)**tmp)
        print((i+2)**tmp)
        ans+=1
        tmp+=1

    while N % (i+2) == 0:
        N = N // (i+2)

if N > 1 :
    ans+1

print(ans)


Fixed code:
import math

N=int(input())

ans=0
arr=[]

tmp=1

#print(int(math.sqrt(N))+5)

for i in range(int(math.sqrt(N))+5):
    tmp=1

    while N % ((i+2)**tmp) == 0:
        N=N / ((i+2)**tmp)
        #print((i+2)**tmp)
        ans+=1
        tmp+=1

    while N % (i+2) == 0:
        N = N // (i+2)

if N > 1 :
    ans+=1

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

import sys
inp = int(input())
x=prime_factorize(inp)
a=0
xset = set(x)
for i in xset:
  z=x.count(i)
  a+=1
  n=1
  ar=(n*(n+1))/2
  while z>ar:
    a+=1
    n+=1
    ar=(n*(n+1))/2
print(a)

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

import sys
inp = int(input())
x=prime_factorize(inp)
a=0
xset = set(x)
for i in xset:
  z=x.count(i)
  a+=1
  n=2
  ar=(n*(n+1))/2
  while z>=ar:
    a+=1
    n+=1
    ar=(n*(n+1))/2
print(a)
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

hoges = factorization(N)

#print(hoges)

ans = 0

for hoge in hoges:
    n = hoge[1]

    i = 0
    tmp = 0
    while True:
        i += 1
        tmp += i

        if(tmp > n):
            break
    
        ans += 1

print(ans)


Fixed code:
N = int(input())
import sys

if(N == 1):
  print(0)
  sys.exit()

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

hoges = factorization(N)

#print(hoges)

ans = 0

for hoge in hoges:
    n = hoge[1]

    i = 0
    tmp = 0
    while True:
        i += 1
        tmp += i

        if(tmp > n):
            break
    
        ans += 1

print(ans)
Buggy code:
import math

def factrization_prime(number):
    factor = {}
    div = 2
    s = math.sqrt(number)
    while div < s:
        div_cnt = 0
        while number % div == 0:
            div_cnt += 1
            number //= div
        if div_cnt != 0:
            factor[div] = div_cnt
        div += 1
    if number > 1:
        factor[number] = 1
    return factor

number = int(input())
factor = factrization_prime(number)
ans = 0
for i in factor.values():
  n = 0
  while n*(n+1)//2 < i:
    n +=  1
  ans += n
print(ans)

Fixed code:
import math

def factrization_prime(number):
    factor = {}
    div = 2
    s = math.sqrt(number)
    while div < s:
        div_cnt = 0
        while number % div == 0:
            div_cnt += 1
            number //= div
        if div_cnt != 0:
            factor[div] = div_cnt
        div += 1
    if number > 1:
        factor[number] = 1
    return factor

number = int(input())
factor = factrization_prime(number)
ans = 0
for i in factor.values():
  n = 0
  while n*(n+1)//2 <= i:
    n +=  1
  ans += n-1
print(ans)
Buggy code:
def main():
    n = int(input())
    ans = 0

    e = 1
    for fac in (2, *(x * 2 + 3 for x in range(pow(10, 12)))):
        while n % (div := pow(fac, e)) == 0:
            n //= div
            ans += 1
            e += 1

        while n % fac == 0:
            n //= fac

        if fac * fac > n:
            break
        e = 1

    if n != 1:
        ans += 1

    print(ans)


if __name__ == '__main__':
    main()


Fixed code:
def main():
    n = int(input())
    ans = 0
    e = 1

    def facs():
        yield 2
        for x in range(10 ** 6):
            yield x * 2 + 3

    for fac in facs():
        while n % (div := pow(fac, e)) == 0:
            n //= div
            ans += 1
            e += 1
        while n % fac == 0:
            n //= fac
        if fac * fac > n:
            break
        e = 1

    if n != 1:
        ans += 1

    print(ans)


if __name__ == '__main__':
    main()
Buggy code:
def main():
    n = int(input())
    ans = 0

    fac = 2
    e = 1
    while True:
        if fac * fac > n:
            break
        div = pow(fac, e)
        if n % div == 0:
            n //= div
            ans += 1
            e += 1
            continue
        while n % fac == 0:
            n //= fac
        if fac == 2:
            fac += 1
        else:
            fac += 2
        e = 1

    if n != 1:
        ans += 1

    print(ans)


if __name__ == '__main__':
    main()


Fixed code:
def main():
    n = int(input())
    ans = 0

    fac = 2
    e = 1
    while True:
        div = pow(fac, e)
        if n % div == 0:
            n //= div
            ans += 1
            e += 1
        else:
            while n % fac == 0:
                n //= fac
            fac += 1
            if fac * fac > n:
                break
            e = 1
    if n != 1:
        ans += 1

    print(ans)


if __name__ == '__main__':
    main()
Buggy code:
def main():
    n = int(input())
    ans = 0

    fac = 2
    e = 1
    while pow(fac, 2) <= n:
        while n % (div := pow(fac, e)) == 0:
            n //= div
            ans += 1
            e += 1

        while n % fac == 0:
            n //= fac

    fac = 3
    e = 1
    while pow(fac, 2) <= n:
        while n % (div := pow(fac, e)) == 0:
            n //= div
            ans += 1
            e += 1

        while n % fac == 0:
            n //= fac
        e = 1
        fac += 2

    if n != 1:
        ans += 1

    print(ans)


if __name__ == '__main__':
    main()


Fixed code:
def main():
    n = int(input())
    ans = 0

    fac = 2
    e = 1
    while pow(fac, 2) <= n:
        while n % (div := pow(fac, e)) == 0:
            n //= div
            ans += 1
            e += 1

        while n % fac == 0:
            n //= fac

        e = 1
        fac += 1

    if n != 1:
        ans += 1

    print(ans)


if __name__ == '__main__':
    main()
Buggy code:
from collections import defaultdict
from itertools import accumulate


def main():
    n = int(input())
    prime_counter = defaultdict(int)
    acc = tuple(accumulate(range(1, 42)))  # 10^12 < 2^39

    f = 2
    while f * f <= n:
        if n % f == 0:
            n //= f
            prime_counter[f] += 1
        else:
            f += 1
    if n != 1:
        prime_counter[f] += 1

    ans = 0
    for c in prime_counter.values():
        for i, x in enumerate(acc):
            if c < x:
                tmp = i
                break
        ans += tmp
    print(ans)


if __name__ == '__main__':
    main()


Fixed code:
from collections import defaultdict
from itertools import accumulate


def main():
    n = int(input())
    prime_counter = defaultdict(int)
    acc = tuple(accumulate(range(1, 42)))  # 10^12 < 2^39

    f = 2
    while n % f == 0:
        n //= f
        prime_counter[f] += 1
    f = 3
    while f * f <= n:
        if n % f == 0:
            n //= f
            prime_counter[f] += 1
        else:
            f += 2
    if n != 1:
        prime_counter[n] += 1

    ans = 0
    for c in prime_counter.values():
        for accum_index, x in enumerate(acc):
            if c < x:
                break
        ans += accum_index
    print(ans)


if __name__ == '__main__':
    main()
Buggy code:
from itertools import accumulate


def main():
    n = int(input())
    prime_counter = [0] * int(n ** 0.5 + 2)
    acc = tuple(accumulate(range(1, 42)))  # 10^12 < 2^39

    f = 2
    while f * f <= n:
        if n % f == 0:
            n //= f
            prime_counter[f] += 1
        else:
            f += 1
    if n != 1:
        prime_counter[f] += 1

    ans = 0
    for c in prime_counter:
        for i, x in enumerate(acc):
            if c < x:
                tmp = i
                break
        ans += tmp
    print(ans)


if __name__ == '__main__':
    main()


Fixed code:
from collections import defaultdict
from itertools import accumulate


def main():
    n = int(input())
    prime_counter = defaultdict(int)
    acc = tuple(accumulate(range(1, 42)))  # 10^12 < 2^39

    f = 2
    while n % f == 0:
        n //= f
        prime_counter[f] += 1
    f = 3
    while f * f <= n:
        if n % f == 0:
            n //= f
            prime_counter[f] += 1
        else:
            f += 2
    if n != 1:
        prime_counter[n] += 1

    ans = 0
    for c in prime_counter.values():
        for i, x in enumerate(acc):
            if c < x:
                tmp = i
                break
        ans += tmp
    print(ans)


if __name__ == '__main__':
    main()
Buggy code:
import math
def check(n):
    count = 0
    end = int(math.sqrt(n)+1)
    for i in range(2,end):
        if n%i==0:
            count += 1
            n/=i
        if n%i==0:
            l = 2
            count2 = 0
            while n%i==0:
                n/=i
                count2+=1
                if count2==l:
                    count+=1
                    count2=0
                    l+=1
    if n==1:
        return 0
    if count==0:
        return 1
    else:
        return count   
n = int(input())
ans = check(n)
print(ans)

Fixed code:
import math
def check(n):
    count = 0
    end = int(math.sqrt(n)+1)
    for i in range(2,end):
        if n%i==0:
            count += 1
            n/=i
        if n%i==0:
            l = 2
            count2 = 0
            while n%i==0:
                n/=i
                count2+=1
                if count2==l:
                    count+=1
                    count2=0
                    l+=1
        if n==1:
            return count
    if n==1:
        return 0
    if count==0:
        return 1
    else:
        return count+1   
n = int(input())
ans = check(n)
print(ans)
Buggy code:
history = set([])

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 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 func(n):
    if n == 1:
        return 
    l = make_divisors(n)
    for i in sorted(l[1:]):
        if i in history:
            continue
        if len(factorization(i)) > 1:
            continue
        history.add(i)
        _ = n // i
        func(_)
        break
    return

N = int(input())
if N == 0:
    print(0)
elif N == 1:
    print(1)
else:
    func(N)
    print(len(history))

Fixed code:
history = set([])

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 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 func(n):
    if n == 1:
        return 
    l = make_divisors(n)
    for i in sorted(l[1:]):
        if i in history:
            continue
        if len(factorization(i)) > 1:
            continue
        history.add(i)
        _ = n // i
        func(_)
        break
    return

N = int(input())
if N == 0:
    print(0)
elif N == 1:
    print(0)
else:
    func(N)
    print(len(history))
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())
F = factorization(n)
counter = 0
for a in range(len(F)):
    B = int((-1+(1+8*F[a][1])**0.5)/2)
    counter += B

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())
F = factorization(n)
counter = 0
for a in range(len(F)):
    B = int((-1+(1+8*F[a][1])**0.5)/2)
    counter += B

if F[0][0] == 1:
    print(0)
else:
    print(counter)
Buggy code:
N = int(input())

p_dic = {}
i=2
while i < N:
  if N % i == 0:
    p_dic[i] = 0
    while N % i == 0:
      p_dic[i] += 1
      N /= i
  i += 1

def foo(x):
  r = 0
  base = 1
  while x >= base:
    x -= base
    r+=1
    base += 1
  return r

ans = 0
for v in p_dic.values():
#  print(v, foo(v))
  ans += foo(v)

print(ans)

Fixed code:
N = int(input())

p_dic = {}
i=2
while i ** 2 <= N:
  if N % i == 0:
    p_dic[i] = 0
    while N % i == 0:
      p_dic[i] += 1
      N /= i
  i += 1

if N > 1:
  p_dic[N] = 1
  
def foo(x):
  r = 0
  base = 1
  while x >= base:
    x -= base
    r+=1
    base += 1
  return r

ans = 0
for v in p_dic.values():
#  print(v, foo(v))
  ans += foo(v)

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 divcount(n):
  cnt=0
  while n>=0:
    n-=cnt+1
    cnt+=1
  return cnt-1

s=factorization(N)
t=[i[1] for i in s]
ans=0
for i in t:
  ans+=divcount(i)
print(ans)

Fixed code:
N=int(input())

if N==1:
  print('0')
  exit()

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 divcount(n):
  cnt=0
  while n>=0:
    n-=cnt+1
    cnt+=1
  return cnt-1

s=factorization(N)
t=[i[1] for i in s]
ans=0
for i in t:
  ans+=divcount(i)
print(ans)
Buggy code:
n = int(input())

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

fact = factorization(n)

ans = 0
for x, y in fact:
    tmp = 1
    while True:
        if (tmp + 1) * (tmp + 2) // 2 <= y:
            tmp += 1
        else:
            break

    ans += tmp

print(ans)


Fixed code:
n = int(input())

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

    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

    fact = factorization(n)

    ans = 0
    for x, y in fact:
        tmp = 1
        while True:
            if (tmp + 1) * (tmp + 2) // 2 <= y:
                tmp += 1
            else:
                break

        ans += tmp

    print(ans)
Buggy code:
# abc169_d.py

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())
lis = factorization(N)
ans = 0
# print(lis)
for i in lis:
    cnt = 1
    target = i[1]
    while target>0:
        if target - cnt >= 0:
            ans += 1
        target -= cnt
        cnt+=1
print(ans)


Fixed code:
# abc169_d.py

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())
lis = factorization(N)
ans = 0
# print(lis)
if N == 1:
    print(0)
    exit()
for i in lis:
    cnt = 1
    target = i[1]
    while target > 0:
        if target - cnt >= 0:
            ans += 1
        target -= cnt
        cnt+=1
print(ans)