Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import sympy
a, b, c = map(int, input().split())

if sympy.sqrt(a) + sympy.sqrt(b) >= sympy.sqrt(c):
    print("No")
else:
    print("Yes")

Fixed submission:
from decimal import Decimal

a, b, c = map(int, input().split())

a = Decimal(a)
b = Decimal(b)
c = Decimal(c)

if a.sqrt() + b.sqrt() < c.sqrt():
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
x = [0] * M
y = [0] * M
c = [0] * M
for i in range(M):
    x[i], y[i], c[i] = map(int, input().split())

min_cost = min(a) + min(b)

for i in range(M):
    min_cost = min(a[x[i]-1] + b[x[i]-1] - c[i], min_cost)

print(min_cost)

Fixed submission:
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

min_cost = min(a) + min(b)

for i in range(M):
    x, y, c = map(int, input().split())
    min_cost = min(a[x-1] + b[y-1] - c, min_cost)

print(min_cost)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

n = int(input())
s = [input() for _ in range(n)]

c = Counter(s)

max_count = c.most_common()[0][1]

a = []

for i in range(len(c)):
    if max_count == c.most_common()[i][1]:
        a.append(c.most_common()[i][0])
    else:
        break

b = sorted(a)

for i in range(len(b)):
    print(b[i])

Fixed submission:
from collections import Counter

n = int(input())
s = [input() for _ in range(n)]

c = Counter(s)

max_count = c.most_common()[0][1]

c = sorted(c.items())

for i in range(len(c)):
    if max_count == c[i][1]:
        print(c[i][0])

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

n = int(input())
s = []

for i in range(n):
    s.append((input()))

c = Counter(s)

max_count = c.most_common()[0][1]

a = []

for i in range(len(c)):
    if max_count == c.most_common()[i][1]:
        a.append(c.most_common()[i][0])
    else:
        break

b = sorted(a)

for i in range(len(b)):
    print(b[i])

Fixed submission:
from collections import Counter

n = int(input())
s = [input() for _ in range(n)]

c = Counter(s)

max_count = c.most_common()[0][1]

c = sorted(c.items())

for i in range(len(c)):
    if max_count == c[i][1]:
        print(c[i][0])
Buggy python submission (verdict: Time Limit Exceeded):
def ex(x):
    s = 0
    p = 1/x
    for i in range(1, x+1):
        s = s + p*i
    return s

n, k = map(int, input().split())
p = list(map(int, input().split()))

m = 0
px = list(map(ex, p))

for j in range(n-k+1):
    sum = 0
    for i in range(j, j+k):
        sum = sum + px[i]
    m = max(sum, m)

print(m)

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))

temp= sum(p[:k])
ans = temp

for i in range(n-k):
    temp = temp - p[i]
    temp = temp + p[i+k]
    ans = max(temp, ans)
    
ans = (ans+k) / 2

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def ex(x):
    s = 0
    p = 1/x
    for i in range(1, x+1):
        s = s + p*i
    return s


n, k = map(int, input().split())
p = list(map(int, input().split()))

m = 0

for j in range(n-k+1):
    sum = 0
    for i in range(j, j+k):
        sum = sum + ex(p[i])
    m = max(sum, m)

print(m)

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))

temp= sum(p[:k])
ans = temp

for i in range(n-k):
    temp = temp - p[i]
    temp = temp + p[i+k]
    ans = max(temp, ans)
    
ans = (ans+k) / 2

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
h = int(input())
i= 0

while(1):
    if h >= 2**(i+1) and h < 2**(i+2):
        print(2**(i+2)-1)
        exit(0)

    i = i + 1

Fixed submission:
h = int(input())
i= 0

if h == 1:
    print(1)
    exit(0)

while(1):
    if h >= 2**(i+1) and h < 2**(i+2):
        print(2**(i+2)-1)
        exit(0)

    i = i + 1
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**9)

a, b, k = map(int, input().split())

if k > 10**9:

for i in range(k):
    if a >= 1:
        a = a - 1
    elif b >= 1:
        b = b - 1

print("{}".format(a) + " {}".format(b))


Fixed submission:
a, b, k = map(int, input().split())

p = k
if a < k:
    k = k - a
    a = 0
else:
    k = k - a
    a = a - p

if k < 0:
    k = 0
b = b - k
if b < 0:
    b = 0

print("{}".format(a) + " {}".format(b))
Buggy python submission (verdict: Runtime Error):
N = int(input())

count = 0
odd = []
even = []
idou = []

for a in range(2, N):
    if N % a == 0:
        if count == 0:
            odd.append(a)
            count = 1
            if N / (a * a) == 1:
                even.append(a)
                count = 0

        elif count == 1:
            even.append(a)
            count = 0
            if N / (a * a) == 1:
                odd.append(a)
                count = 1

for c in range(len(odd)):
    idou.append(odd[c] + even[len(odd)-c-1])

result = min(idou) - 2

print(result)


Fixed submission:
import math

N = int(input())

sqrtN = int(math.sqrt(N))

for i in reversed(range(1, sqrtN+1)):
    if N % i == 0:
        print(int(i + N/i - 2))
        quit(0)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
b = []

for i in range(1, n+1):
    num = a.index(i)
    b.append(num+1)

print(' '.join(map(str, b)))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = [0]*n

for i in range(0, n):
    b[a[i]-1] = i + 1


print(' '.join(map(str, b)))
Buggy python submission (verdict: Time Limit Exceeded):
def minus(n):
    return n - 1

n,k,q = map(int,input().split())
a = [0] * q
b = [0] * n

member = [k]*n

for i in range(q):
    a[i] = int(input())
    member[a[i]-1] = member[a[i]-1] + 1
    member = list(map(minus, member))

for k in range(n):
    if member[k] <= 0:
        print("No")
    else:
        print("Yes")

Fixed submission:
n,k,q = map(int,input().split())
a = [0] * q

member = [k] * n

for i in range(q):
    a[i] = int(input())
    member[a[i]-1] = member[a[i]-1] + 1

for j in range(n):
    if member[j] - q <= 0:
        print("No")
    else:
        print("Yes")

Buggy python submission (verdict: Time Limit Exceeded):
def minus(n):
    return n - 1

n,k,q = map(int,input().split())
a = [0] * q
b = [0] * n

for i in range(q):
    a[i] = int(input())

member = [k]*n

for j in range(q):
    member[a[j]-1] = member[a[j]-1] + 1
    member = list(map(minus,member))

for k in range(n):
    if member[k] <= 0:
        print("No")
    else:
        print("Yes")

Fixed submission:
n,k,q = map(int,input().split())
a = [0] * q

member = [k] * n

for i in range(q):
    a[i] = int(input())
    member[a[i]-1] = member[a[i]-1] + 1

for j in range(n):
    if member[j] - q <= 0:
        print("No")
    else:
        print("Yes")
Buggy python submission (verdict: Runtime Error):
a, b = list(map(int, input().split()))

c = 0

if b == 1:
    c = 0
elif b / a == 1:
    c = b // a
else:
    c = b // a + 1

print(c)

Fixed submission:
s = input()
t = input()
count = 0

for i in range(len(s)):
    if s[i] == t[i]:
        count = count + 1

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [0] * n
for i in range(n):
    a[i] = int(input())

for i in range(0, n):
    if a[i] == max(a):
        print(sorted(a)[-2])
    else:
        print(max(a))

Fixed submission:
n = int(input())
a = [0] * n
for i in range(n):
    a[i] = int(input())

maxa = max(a)
index_max = a.index(maxa)

for i in range(0, n):
    if i == index_max:
        print(sorted(a)[-2])
    else:
        print(maxa)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [0] * n
for i in range(n):
    a[i] = int(input())

for i in range(0, n):
    tmp = a[i]
    a.remove(a[i])
    print(max(a))
    a.insert(i, tmp)

Fixed submission:
n = int(input())
a = [0] * n
for i in range(n):
    a[i] = int(input())

maxa = max(a)
index_max = a.index(maxa)

for i in range(0, n):
    if i == index_max:
        print(sorted(a)[-2])
    else:
        print(maxa)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [0] * n
for i in range(n):
    a[i] = int(input())

for i in range(0, n):
    tmp = a[i]
    a.remove(a[i])
    print(max(a))
    a.insert(i, tmp)

Fixed submission:
n = int(input())
a = [0] * n
for i in range(n):
    a[i] = int(input())

maxa = max(a)
index_max = a.index(maxa)

for i in range(0, n):
    if i == index_max:
        print(sorted(a)[-2])
    else:
        print(maxa)
Buggy python submission (verdict: Time Limit Exceeded):
l, r = map(int, input().split())

mod = 2019
minij = l * (l + 1)

for i in range(l, r):
    for j in range(i+1, r+1):
        if (i * j) % mod < minij:
            minij = (i*j) % mod
            if minij == 0:
                print(minij)
                exit(0)

print(minij)

Fixed submission:
l, r = map(int, input().split())

mod = 2019
minij = 2020

for i in range(l, r):
    for j in range(i+1, r+1):
        if (i * j) % mod < minij:
            minij = (i*j) % mod
            if minij == 0:
                print(minij)
                exit(0)

print(minij)
Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d = map(int, input().split())

count_c = int(b / c) - int((a-1) / c)
count_d = int(b / d) - int((a-1) / d)
lcm_cd = c * d / math.gcd(c, d)
count_cd = int(b / lcm_cd) - int((a-1) / lcm_cd)

print(b - a - int(count_c+count_d-count_cd) + 1)


Fixed submission:
import fractions
a,b,c,d = map(int, input().split())

cnt_c = b // c - (a-1) // c
cnt_d = b // d - (a-1) // d
lcm = c * d // fractions.gcd(c, d)
cnt_cd = b // lcm - (a-1) // lcm

mul = cnt_c + cnt_d - cnt_cd

print(b - a + 1 - mul)

Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d = map(int, input().split())

count_c = (b // c) - ((a-1) // c)
count_d = (b // d) - ((a-1) // d)
lcm_cd = c * d / math.gcd(c, d)
count_cd = (b // lcm_cd) - ((a-1) // lcm_cd)

print(b - a - int(count_c+count_d-count_cd) + 1)


Fixed submission:
import fractions
a,b,c,d = map(int, input().split())

cnt_c = b // c - (a-1) // c
cnt_d = b // d - (a-1) // d
lcm = c * d // fractions.gcd(c, d)
cnt_cd = b // lcm - (a-1) // lcm

mul = cnt_c + cnt_d - cnt_cd

print(b - a + 1 - mul)

Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d = map(int, input().split())

count_c = b // c - (a-1) // c
count_d = b // d - (a-1) // d
lcm_cd = c * d / math.gcd(c, d)
count_cd = b // lcm_cd - (a-1) // lcm_cd

print(b - a - int(count_c+count_d-count_cd) + 1)


Fixed submission:
import fractions
a,b,c,d = map(int, input().split())

cnt_c = b // c - (a-1) // c
cnt_d = b // d - (a-1) // d
lcm = c * d // fractions.gcd(c, d)
cnt_cd = b // lcm - (a-1) // lcm

mul = cnt_c + cnt_d - cnt_cd

print(b - a + 1 - mul)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h = [int(x) for x in input().split()]

dp = [0]*n

dp[0] = 0
dp[1] = abs(h[1]-h[0])

for i in range(2,n):
    dp[i] = abs(h[i] - h[i-1]) + dp[i-1]
    for j in range(2,k+1):
        if i-j >= 0:
            dp[i] = min(dp[i], abs(h[i]-h[i-j])+dp[i-j])

print(dp[-1])


Fixed submission:
n, k = map(int, input().split())
h = [int(x) for x in input().split()]

dp = [0]*n

dp[0] = 0
dp[1] = abs(h[1]-h[0])

for i in range(2,n):
    dp[i] = abs(h[i] - h[i-1]) + dp[i-1]
    for j in range(2,k+1):
        if i-j >= 0:
            dp[i] = min(dp[i], abs(h[i]-h[i-j])+dp[i-j])

print(dp[-1])
Buggy python submission (verdict: Time Limit Exceeded):
import collections

n, k = map(int, input().split())
a = list(map(int, input().split()))

c = collections.Counter(a)
sum = 0

if len(c) <= k:
    print("0")
    exit(0)

for i in range(0, k):
    sum = sum + c.most_common()[i][1]

print(max(len(a)-sum, 0))

Fixed submission:
import collections

n, k = map(int, input().split())
a = list(map(int, input().split()))

c = collections.Counter(a)
b = list(sorted(c.values(), reverse=True))
sum = 0

if len(c) <= k:
    print("0")
    exit(0)

for i in range(0, k):
    sum = sum + b[i]

print(max(len(a)-sum, 0))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = []

for i in range(n):
    a = int(input())
    if a in ans:
        ans.remove(a)
    else:
        ans.append(a)

print(len(ans))


Fixed submission:
n = int(input())
ans = set()

for i in range(n):
    a = int(input())
    if a in ans:
        ans.remove(a)
    else:
        ans.add(a)

print(len(ans))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(x) for x in input().split()]

ans = 0

for i in range(min(a), max(a)+1):
    cnt = 0
    for j in range(n):
        if abs(a[j]-i) <= 1:
            cnt += 1
    if cnt > 0:
        ans = max(ans, cnt)

print(ans)

Fixed submission:
n = int(input())
a = [int(x) for x in input().split()]

d = [0] * (10**5)

for i in range(n):
    d[a[i]] += 1

ans = 1

for j in range(1, n-1):
    ans = max(ans, d[j-1] + d[j] + d[j+1])

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(x) for x in input().split()]

b = []

for i in range(n):
    b.append(a[i])
    b = b[::-1]

print(*b)

Fixed submission:
n = int(input())
a = [int(x) for x in input().split()]

even = []
odd = []

for i in range(n):
    if i % 2 == 0:
        odd.append(a[i])
    else:
        even.append(a[i])

if n % 2 == 0:
    even.reverse()
    ans = even + odd
    print(*ans)
else:
    odd.reverse()
    ans = odd + even
    print(*ans)
Buggy python submission (verdict: Runtime Error):
import math
from decimal import Decimal

N = int(input())

res = ""

alp = "0abcdefghijklmnopqrstuvwxyz"

while N > 0:
    if N > 26:
        
        NN = N//26
        m = N - NN*26
        N = N//26
        # print(alp[m])
        res = alp[m] + res
    else:
        # print(alp[N])
        res = alp[m] + res
        N = 0

print(res)

Fixed submission:
import math
from decimal import Decimal

N = int(input())

res = ""

alp = "0abcdefghijklmnopqrstuvwxyz"

while N > 0:
    # print(N)
    if N > 26:
        
        NN = N//26
        # print("NN: ", NN)
        # print(N - NN*26)
        m = N - NN*26
        N = N//26
        # print("m is ", m)
        if m==0:
            m=26
            N = N-1
        # print(alp[m], "!")
        res = alp[m] + res
    else:
        # print(alp[N])
        # print(alp[N], "!")
        res = alp[N] + res
        N = 0

print(res)
Buggy python submission (verdict: Runtime Error):
A = list(map(int, input().split()))

for i in range(A):
    if A[i] == i+1:
        print(i+1)


Fixed submission:
A = list(map(int, input().split()))

for i in range(len(A)):
    if A[i] != i+1:
        print(i+1)
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
return A*B


Fixed submission:
A, B = map(int, input().split())
print(A*B)
Buggy python submission (verdict: Time Limit Exceeded):
import math
N = int(input())
A = []
B = []
for i in range(N):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)


sA = sorted(A)
sB = sorted(B, reverse=True)



m = N//2

if N%2 == 1:
    minMid = sA[m]
    maxMid = sB[m]

    print(maxMid-minMid+1)
    exit()
else:
    m = m-1
    minMidL = sA[m]
    maxMidL = sB[m+1]

    minMidH = sA[m+1]
    maxMidH = sB[m]
    # print(minMidL, maxMidL)
    # print(minMidH, maxMidH)
    # print("=======")
    ans = set()
    for i in range(minMidL, maxMidL+1):
        for j in range(max(i, minMidH), maxMidH+1):
            # print(i, j)
            ans.add(i+j)
    print(len(ans))






Fixed submission:
import math
N = int(input())
A = []
B = []
for i in range(N):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)


sA = sorted(A)
sB = sorted(B, reverse=True)



m = N//2

if N%2 == 1:
    minMid = sA[m]
    maxMid = sB[m]

    print(maxMid-minMid+1)
    exit()
else:
    m = m-1
    minMidL = sA[m]
    maxMidL = sB[m+1]

    minMidH = sA[m+1]
    maxMidH = sB[m]
    # print(minMidL, maxMidL)
    # print(minMidH, maxMidH)
    # print("=======")
    ans = set()
    aa = minMidL + minMidH
    bb = maxMidL + maxMidH
    # print(aa, bb)
    print(bb-aa + 1)
    # for i in range(minMidL, maxMidL+1):
    #     for j in range(max(i, minMidH), maxMidH+1):
            
    #         ans.add(i+j)
    # print(len(ans))
Buggy python submission (verdict: Runtime Error):
A, B, C, K = map(int, input().split())

if A >= K:
    print(A)
elif A+B >=K:
    print(A)
else A+B+C >=K:
    nc = K - A - B
    print(A - nc)



Fixed submission:
A, B, C, K = map(int, input().split())

score = 0
if A < K:
    K -=A
    score += A
else:
    score = K
    print(score)
    exit()

if B < K:
    K -=B
else:
    print(score)
    exit()

if C < K:
    K -=C
    score -= C
else:
    score -= K
    print(score)
    exit()
print(score)
Buggy python submission (verdict: Runtime Error):
import copy
N, M, X = map(int, input().split())


C =[]
A = {}

for i in range(N):
    ipt = list(map(int, input().split()))
    C.append(ipt[0])
    A[i] = ipt[1:]

bestscore = 99999999999
def rec(n, score, money):
    global bestscore
    if n==N: return
    s = copy.deepcopy(score)
    rec(n+1, s, money)

    money += C[n]
    for i in range(M):
        score[i] += A[n][i]
    

    for i in range(M):
        if score[i] < X:
            s = copy.deepcopy(score)
            rec(n+1, s, money)
            return
    bestscore = min(bestscore, money)

score = [0 for i in range(N)]

rec(0, score, 0)
if bestscore == 99999999999:
    print(-1)
else:
    print(bestscore)

Fixed submission:
import copy
N, M, X = map(int, input().split())


C =[]
A = {}

for i in range(N):
    ipt = list(map(int, input().split()))
    C.append(ipt[0])
    A[i] = ipt[1:]

bestscore = 99999999999
def rec(n, score, money):
    global bestscore
    if n==N: return
    s = copy.deepcopy(score)
    rec(n+1, s, money)

    money += C[n]
    for i in range(M):
        score[i] += A[n][i]
    

    for i in range(M):
        if score[i] < X:
            s = copy.deepcopy(score)
            rec(n+1, s, money)
            return
    bestscore = min(bestscore, money)

score = [0 for i in range(M)]

rec(0, score, 0)
if bestscore == 99999999999:
    print(-1)
else:
    print(bestscore)

Buggy python submission (verdict: Runtime Error):
N, M, X = map(int, input().split())


C =[]
A = {}

for i in range(N):
    ipt = list(map(int, input().split()))
    C.append(ipt[0])
    A[i] = ipt[1:]

bestscore = 99999999999
def rec(n, score, money):
    global bestscore
    if n==N: return
    rec(n+1, score[:], money)

    money += C[n]
    for i in range(M):
        score[i] += A[n][i]
    

    for i in range(M):
        if score[i] < X:
            rec(n+1, score[:], money)
            return
    bestscore = min(bestscore, money)

score = [0 for i in range(N)]

rec(0, score, 0)
if bestscore == 99999999999:
    print(-1)
else:
    print(bestscore)

Fixed submission:
import copy
N, M, X = map(int, input().split())


C =[]
A = {}

for i in range(N):
    ipt = list(map(int, input().split()))
    C.append(ipt[0])
    A[i] = ipt[1:]

bestscore = 99999999999
def rec(n, score, money):
    global bestscore
    if n==N: return
    s = copy.deepcopy(score)
    rec(n+1, s, money)

    money += C[n]
    for i in range(M):
        score[i] += A[n][i]
    

    for i in range(M):
        if score[i] < X:
            s = copy.deepcopy(score)
            rec(n+1, s, money)
            return
    bestscore = min(bestscore, money)

score = [0 for i in range(M)]

rec(0, score, 0)
if bestscore == 99999999999:
    print(-1)
else:
    print(bestscore)
Buggy python submission (verdict: Runtime Error):

S = input()
Q = int(input())

# print(S, Q)

queries = []
for i in range(Q):
    query = input()
    queries.append(query)

from collections import deque
slist = deque()
slist.append(S)
isReversed = False
for query in queries:
    if query == "1":
        isReversed = not isReversed
    else:
        t, f, c = query.split()
        if f == '1':
            if isReversed:
                slist.append(c)
            else:
                slist.appendleft(c)
        else:
            if isReversed:
                slist.appendleft(c)
            else:
                slist.append(c)
# slist = list(slist)
if isReversed:
    slist.reverse()

print("".join(slist))
# print(S)

Fixed submission:
S = input()
if S == "AAA" or S=="BBB":
    print("No")
else:print("Yes")
Buggy python submission (verdict: Runtime Error):
s = input()
# print(s)

score = 0
for blocksize in range(1,len(s)+1):
    for startpoint in range(len(s)):
        # print("hi", startpoint+blocksize)
        if startpoint+blocksize >= (len(s)+1): continue
        block = s[startpoint:startpoint+blocksize]
        ss = int(block) * math.factorial(startpoint) * math.factorial(len(s) - (startpoint+blocksize))
        # print("{} ({}, {}): {}".format(block, startpoint, len(s) - (startpoint + blocksize), ss))
        score += ss
print(score)
exit()

Fixed submission:
def f(n):
    if n <= 0:
        return 1
    return 2**(n-1)

s = input()

score = 0
for blocksize in range(1,len(s)+1):
    for startpoint in range(len(s)):
        if startpoint+blocksize >= (len(s)+1): continue
        block = s[startpoint:startpoint+blocksize]  
        ss = int(block) * f(startpoint) * f(len(s) - (startpoint+blocksize))
        # print("{} ({}, {}): {}".format(block, startpoint, len(s) - (startpoint + blocksize), ss))
        score += ss
print(score)
exit()
Buggy python submission (verdict: Time Limit Exceeded):
K = int(input())

lis = []
val = -1
num = 0
tens = 1
for i in range(1, 10 ** 6 + 1):
  num += 7 * tens
  if num % K == 0:
    print(i)
    exit()
  tens *= 10

Fixed submission:
K = int(input())

x = 7 % K

for i in range(1, K + 8):
  if x == 0:
    print(i)
    exit()
  
  x = (10 * x + 7) % K
  
print(-1)
Buggy python submission (verdict: Runtime Error):
from collections import deque
N = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
 
    divisors.sort()
    return divisors

q = deque()
for x in make_divisors(N):
  q.append(x)
  
count = 0
done = []
while N != 1:
  x = q.popleft()
  if x == 1:
    continue
  
  if x in done:
    mul = x
    while mul in done:
      mul *= q.popleft()
    
  if N % x == 0:
    N = N // x
    count += 1
    done.append(x)

print(count)

Fixed submission:
from collections import deque
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)
    a.sort()
    return a

q = deque()
prime = prime_factorize(N)
for x in prime:
  q.append(x)

#print(q)
count = 0
done = []
while N != 1:
  break_flag = False
  if len(q) == 0:
    break
  x = q.popleft()
  #print(N, q, x)
  if x == 1:
    continue
  
  if x in done:
    mul = x
    while mul in done:
      if len(q) == 0:
        break_flag = True
        break
      pop = q.popleft()
      #print(x, pop)
      if x != pop:
        #print(x, pop, q)
        q.appendleft(pop)
        #print(q)
        break_flag = True
        break
      mul *= pop
    x = mul
    if break_flag:
      continue
  
  if N % x == 0:
    N = N // x
    count += 1
    done.append(x)

print(count)
#print(done)