qyliang/CodeNanoFix huggingface dataset:
Buggy code:
import numpy as np
import math
from decimal import *
#from numba import njit

def getVar():
    return map(int, input().split())
def getArray():
    return list(map(int, input().split()))
def getNumpy():
    return np.array(list(map(int, input().split())), dtype='int64')

def factorization(n):
    d = {}
    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
            d.append({i, cnt})

    if temp!=1:
        d.append({temp, 1})

    if d==[]:
        d.append({n, 1})

    return d

def main():
    N = int(input())
    d = factorization(N)
    count = 0

    for v in d.values():
        i = 1
        while(v >= i):
            v -= i
            i += 1
            count += 1
        
    print(count)


main()

Fixed code:
import numpy as np
import math
from decimal import *
#from numba import njit

def getVar():
    return map(int, input().split())
def getArray():
    return list(map(int, input().split()))
def getNumpy():
    return np.array(list(map(int, input().split())), dtype='int64')

def factorization(n):
    d = {}
    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
            d.update({i: cnt})

    if temp!=1:
        d.update({temp: 1})

    if d==[]:
        d.update({n:1})

    return d

def main():
    N = int(input())
    d = factorization(N)
    count = 0

    for v in d.values():
        i = 1
        while(v >= i):
            v -= i
            i += 1
            count += 1
        
    print(count)


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

a = factorization(n)

cnt = 0
for i in range(len(a)):
    tmp = a[i][1]
    for j in range(1,100):
        tmp -= j
        if tmp >= 0:
            cnt += 1
        else:
            break

print(cnt)

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

a = factorization(n)

cnt = 0
for i in range(len(a)):
    tmp = a[i][1]
    for j in range(1,100):
        tmp -= j
        if tmp >= 0:
            cnt += 1
        else:
            break

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

A=factorization(N)
P=[row[1] for row in A]

ans=0

for i in range(len(P)):
    c=1
    while P[i]>=c:
        P[i]-=c
        c+=1
        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

A=factorization(N)
P=[row[1] for row in A]
if A[0][0]==1:
    print(0)
    exit()

ans=0

for i in range(len(P)):
    c=1
    while P[i]>=c:
        P[i]-=c
        c+=1
        ans+=1

print(ans)
Buggy code:
n = int(input())
primes = dict()
p = 2

while p * p < n:
  if n % p == 0:
    primes[p] = 0
    while n % p == 0:
      n //= p
      primes[p] += 1
  p += 1
if p * p == n:
  primes[p] = 2
elif n >= p:
  primes[n] = 1

count = 0
for e in primes.values():
  c = 1
  while e >= c:
    e -= c
    c += 1
  count += c
  
print(count)

Fixed code:
n = int(input())
primes = dict()
p = 2

while p * p < n:
  if n % p == 0:
    primes[p] = 0
    while n % p == 0:
      n //= p
      primes[p] += 1
  p += 1
if p * p == n:
  primes[p] = 2
elif n >= p:
  primes[n] = 1

count = 0
for e in primes.values():
  c = 1
  while c * (c + 1) // 2 <= e:
    c += 1
  count += c - 1
  
print(count)
Buggy code:
import math

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
array = factorization(n)
#print(array)

array2 = [row[1] for row in array]

for i in array2:
    ans += math.floor(math.sqrt(2*i+9/4)-1/2)
    #print(math.floor(math.sqrt(2*i+9/4)-1/2))

print(ans)


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


n = int(input())
if n==1:
    print(0)
    sys.exit()
ans = 0
array = factorization(n)
#print(array)

array2 = [row[1] for row in array]

for i in array2:
    ans += math.ceil(math.sqrt(2*i+9/4)-1/2)-1
    #print(math.ceil(math.sqrt(2*i+9/4)-1/2)-1)

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

itm = collections.Counter(prime_factorize(n))

# print(itm)

ans = 0

for i in itm.keys():
    num = 1
    while True:
        if itm[i] - num < 0:
            break
        else:
            ans+=1
            itm[i] -= num
            num += 1

# print(itm)

counter = 0

for i in itm.keys():
    if itm[i] != 0:
        counter += 1

if counter != 1:
    ans += 1 
        
    
print(ans)

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

itm = collections.Counter(prime_factorize(n))

ans = 0

for i in itm.keys():
    num = 1
    while True:
        if itm[i] - num < 0:
            break
        else:
            ans+=1
            itm[i] -= num
            num += 1

counter = 0

for i in itm.keys():
    if itm[i] != 0:
        counter += 1

# if counter != 1:
#     ans += 1 
    
print(ans)
Buggy code:
def divisor(n): 
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table
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

n = int(input())
a = divisors(n)
cnt = 0
for i in range(1, len(a)):
    b = prime_decomposition(a[i])
    if len(list(set(b))) == 1:
        if n % a[i] == 0:
            n //= a[i]
            cnt += 1
print(cnt)

Fixed code:
def divisor(n): 
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table
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

n = int(input())
a = sorted(divisor(n))
cnt = 0
for i in range(1, len(a)):
    b = prime_decomposition(a[i])
    if len(list(set(b))) == 1:
        if n % a[i] == 0:
            n //= a[i]
            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

n=int(input())
x=factorization(n)
ans=0
for i in range(len(x)):
  p=x[i][1]
  j=1
  while True:
    if p>=j:
      p-=j
      ans+=1
      j+=1
    if p<j:
      break
print(ans)    
    




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

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

if n==1:
  print(0)
  exit()
for i in range(len(x)):
  p=x[i][1]
  j=1
  while True:
    if p>=j:
      p-=j
      ans+=1
      j+=1
    if p<j:
      break
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())
ans=factorization(N)
cnt=0
if N==1:
  print("0")
  exit()
for i in ans:
  num=i[1]
  j=1
  while True:
    num=num-j
    j+=1
    cnt+=1
    if num<=0:
      break
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())
ans=factorization(N)
cnt=0
if N==1:
  print("0")
  exit()
for i in ans:
  num=i[1]
  j=1
  while num-j>=0:
    num=num-j
    j+=1
    cnt+=1
print(cnt)
Buggy 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

#n = 997764507000
A = prime_factorize(n)
C = collections.Counter(A)


count = 0
print(C.values())
for v in C.values():
    i = 1
    while v >= i*(i+1)/2:
        i += 1
    count += i-1
print(count)

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

#n = 997764507000
A = prime_factorize(n)
C = collections.Counter(A)


count = 0
#print(C.values())
for v in C.values():
    i = 1
    while v >= i*(i+1)/2:
        i += 1
    count += i-1
print(count)
Buggy code:
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
a = prime_factorize(n)
b = list(set(a))
total = 0
for j in range(len(b)):
    c  = len([i for i, x in enumerate(a) if x == list(set(a))[j]])
    y = 1
    while c>0:
        c -= y
        y += 1
        if c>=0:
            total +=1
 

Fixed code:
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
a = prime_factorize(n)
b = list(set(a))
total = 0
for j in range(len(b)):
    c  = len([i for i, x in enumerate(a) if x == list(set(a))[j]])
    y = 1
    while c>0:
        c -= y
        y += 1
        if c>=0:
            total +=1
print(total)
Buggy code:
n = int(input())

def factorization(n):
    arr = []
    if n == 1:
        return 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

f_list = factorization(n)
ans = 0

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

print(ans-2)

Fixed code:
n = int(input())

def factorization(n):
    arr = []
    if n == 1:
        return 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

f_list = factorization(n)
ans = 0

for i in range(len(f_list)):
    _tmp = f_list[i][1]
    j = 1
    while _tmp >= 0:
        _tmp -= j
        j += 1
    ans += j-2

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


N = int(input())
l = prime_factorize(N)
m = set(l)
l2 = list(m)
ans = 0
for i in range(len(l2)):
    x = l.count(l2[i]))
    while x >= 2:
        x  = x/2
        ans += 1
print(ans)

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


N = int(input())
l = prime_factorize(N)
m = set(l)
l2 = list(m)
ans = 0

for i in range(len(l2)):
    x = l.count(l2[i])
    y = 1
    while x >= y:
        x = x - y
        y += 1
        ans += 1
print(ans)
Buggy code:
# D - Div Game
from collections import deque

def pf(N):
    ans = deque([])
    p = 2
    while N>1:
        if N%p==0:
            k = 0
            while N%p==0:
                N //= p
                k += 1
            ans.append(k)
        p += 1+(p>2)
    return ans

def func(a):
    tmp = 0
    while True:
        a -= tmp+1
        if a<0:
            return tmp
        else:
            tmp += 1

N = int(input())
ans = 0
l = pf(N)
while len(l)>0:
    ans += func(l.popleft())
print(ans)

Fixed code:
# D - Div Game
from collections import deque

def pf(N):
    ans = deque([])
    p = 2
    while N>1:
        if N%p==0:
            k = 0
            while N%p==0:
                N //= p
                k += 1
            ans.append(k)
        p += 1+(p>2)
        if p**2>N:
            p = N
    return ans

def func(a):
    tmp = 0
    while True:
        a -= tmp+1
        if a<0:
            return tmp
        else:
            tmp += 1

N = int(input())
ans = 0
l = pf(N)
while len(l)>0:
    ans += func(l.popleft())
print(ans)
Buggy code:
t=1
while (t):
	t-=1
	n=int(input())
	ans=0
	power=0
	#it is the power of every prime number
	#and as z is always a prime numer we should not bother about
	# combiations of prime numer dividing N
	for i in range(2,1000000):
		power=0
		j=1
		if(n%i==0):
			while(n%i==0):
				power+=1
				n=(n//i)
			while(power>=j):
				power-=j
				j+=1
				ans+=1
	print(ans)

Fixed code:
n=int(input())
ans=0
#it is the power of every prime number
#and as z is always a prime numer we should not bother about
# combiations of prime numer dividing N
for i in range(2,1000010):
	power=0
	j=1
	if(n%i==0):
		while(n%i==0):
			power+=1
			n=(n//i)
		while(power>=j):
			power-=j
			j+=1
			ans+=1
if(n>1):
	ans+=1
print(ans)
Buggy code:
from math import sqrt
n=int(input())
rn=int(sqrt(n))
s=[0]*(rn+1)
s[0]=-1
s[1]=-1
t=[0]*(rn+1)
for i in range(2,rn+1):
    if s[i] != 0:
        continue
    s[i] = i
    j = i
    while j < rn + 1:
        t[j] = 1
        j *= i
        for j in range(i * i, rn + 1):
            if s[j] == 0:
                s[j] == i

result = 0
last = -1
for i in range(2,rn+1):
    if t[i] == 0:
        continue
    if n % i == 0:
        result += 1
        n //= i
        last =i
if n != 1 and n > rn:
    result += 1
print(result)

Fixed code:
from math import sqrt

N = int(input())

rn = int(sqrt(N))
sieve = [0] * (rn + 1)
sieve[0] = -1
sieve[1] = -1
t = [0] * (rn + 1)
for i in range(2, rn + 1):
    if sieve[i] != 0:
        continue
    sieve[i] = i
    j = i
    while j < rn + 1:
        t[j] = 1
        j *= i
    for j in range(i * i, rn + 1, i):
        if sieve[j] == 0:
            sieve[j] = i

result = 0
last = -1
for i in range(2, rn + 1):
    if t[i] == 0:
        continue
    if N % i == 0:
        result += 1
        N //= i
        last = i
if N != 1 and N > rn:
    result += 1
print(result)
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

z = factorization(int(input()))
if z[0][1] == 1 :
    print(0)
    exit()
i = 1
ans = 0
flag = True
while flag:
    flag2 = False
    for j in range(len(z)):
        if z[j][1] >= i :
            z[j][1] -= i
            ans += 1
            flag2 = True

    i += 1
    if flag2 == False: flag = False
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])
    return arr

z = factorization(int(input()))
i = 1
ans = 0
flag = True
while flag:
    flag2 = False
    for j in range(len(z)):
        if z[j][1] >= i:
            z[j][1] -= i
            ans += 1
            flag2 = True

    i += 1
    if flag2 == False: flag = False
print(ans)
Buggy code:
from collections import deque

m=int(input())
def fa(n):
    arr =deque([])
    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

x=0
count=0
for i,j in fa(m):
    for k in range(10**12):
        if j<=k*(k+1)//2:
            x=k
            break
    count+=x


print(count)


Fixed code:
from collections import deque

m=int(input())
def fa(n):
    arr =deque([])
    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

x=0
count=0
for i,j in fa(m):
    # print(i,j)
    for k in range(10**12):
        if j<k*(k+1)//2:
            x=k-1
            break
        elif j==k*(k+1)//2:
            x=k
            break
    count+=x


print(count)
Buggy code:
    n=int(input())
    from math import sqrt as S 
    pf=[]
    for i in range(2,int(S(n))+1):
        if n%i==0:
            c=0 
            while n%i==0:
                n//=i 
                c+=1 
            pf.append([i,c])
    if n>1:
        pf.append([n,1])
    cnt=0 
    def search(x):
        i=1 
        while i(i+1)//2<=x:
            i+=1 
        return i-1 
    for x in range(len(pf)):
        a=pf[x][0]
        b=pf[x][1]
        cnt+=search(b)
    print(cnt)

Fixed code:
n=int(input())
from math import sqrt as S 
pf=[]
for i in range(2,int(S(n))+1):
    if n%i==0:
        c=0 
        while n%i==0:
            n//=i 
            c+=1 
        pf.append([i,c])
if n>1:
    pf.append([n,1])
cnt=0 
def search(x):
    i=1 
    while i*(i+1)//2<=x:
        i+=1 
    return i-1 
for x in range(len(pf)):
    a=pf[x][0]
    b=pf[x][1]
    cnt+=search(b)
print(cnt)
Buggy code:
N = int(input())
things = []
final = []
c = N
for i in range(2, c):
	if i*i > N:
		break
	count = 0
	if c%i == 0:
		while c%i == 0:
			c//=i
			count += 1
		things.append(count)
final = 0
for x in things:
	count = 0
	start = 1
	step = 2
	while start <= x:
		start += step
		step += 1
		count += 1
	final += count

print(1) if things == [] else print(final)

Fixed code:
N = int(input())
things = []
c = N
for i in range(2, c):
	if i*i > N:
		break
	count = 0
	if c%i == 0:
		while c%i == 0:
			c//=i
			count += 1
		things.append(count)
if c > 1:
	things.append(1)
final = 0
for x in things:
	count = 0
	start = 1
	step = 2
	while start <= x:
		start += step
		step += 1
		count += 1
	final += count

print(final)
Buggy code:
n = int(input())

def factorization(n):
    d = {}
    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
            d[i] = cnt

    if temp!=1:
        d[temp] = 1

    if d.keys()==[]:
        d[n] = 1

    return d

def get_a(n):
    N = n
    if n == 1:
        return [1]
    elif n==2:
        return [2]
    else:
        a = [1]

    while 1:
        n_temp = n - a[-1]
        #print(n_temp, a)
        if n_temp<=0:
            a.pop()
            a[-1] = N - sum(a[:-1])
            break
        else:
            n = n_temp
        a.append(a[-1]+1)
    #print(n_temp, a)
    return a

ans = 0
fact_dict = factorization(n)
#print(fact_dict)

for key, val in fact_dict.items():
    #print(key, val, get_a(val))
    ans += len(get_a(val))

if ans>0:
    print(ans)
else:
    print(0)


Fixed code:
n = int(input())

def factorization(n):
    d = {}
    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
            d[i] = cnt

    if temp!=1:
        d[temp] = 1

    if d.keys()==[]:
        d[n] = 1

    return d

def get_a(n):
    N = n
    if n == 1:
        return [1]
    elif n==2:
        return [2]
    else:
        a = [1]

    while 1:
        n_temp = n - a[-1]
        #print(n_temp, a)
        if n_temp<0:
            a.pop()
            a[-1] = N - sum(a[:-1])
            break
        elif n_temp == 0:
            break
        else:
            n = n_temp
        a.append(a[-1]+1)
    #print(n_temp, a)
    return a

ans = 0
fact_dict = factorization(n)
#print(fact_dict)

for key, val in fact_dict.items():
    #print(key, val, get_a(val))
    ans += len(get_a(val))

if ans>0:
    print(ans)
else:
    print(0)