Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())


hist = []
for _ in range(M):
    p, s = input().split()

    try:
        hist.index(p+'AC')
    except:
        hist.append(p+s)

ans = ''.join(hist)
ans_ac = ans.count('AC')
ans_wa = ans.count('WA')
print(ans_ac, ans_wa)


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

ac = 0
wa = 0

hist_ac = [0] * N
hist_wa = [0] * N
for _ in range(M):
    p, s = input().split()
    p = int(p) - 1
    if hist_ac[p] == 0:
        if s == 'AC':
            hist_ac[p] = 1
            ac += 1
            wa += hist_wa[p]
        else:
            hist_wa[p] += 1

print(ac, wa)

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

ans_wa = 0
ans_ac = 0

p0, s0 = input().split()
if s0 == 'WA':
    ans_wa = 1
    ans_ac = 0
    ac_flag = False
elif s0 == 'AC':
    ans_wa = 0
    ans_ac = 1
    ac_flag = True

for i in range(M-1):
    p, s = input().split()
    if p == p0:
        if s == 'WA' and ac_flag is False: # これまでWAで今回もWAの時
            ans_wa += 1
        elif s == 'AC' and ac_flag is False: # 初ACの時
            ans_ac += 1
            ac_flag = True
    elif p != p0: #新しい問題
        if s == 'WA':
            ans_wa += 1
            ac_flag = False
        elif s == 'AC':
            ans_ac += 1
            ac_flag = True
    p0 = p
    s0 = s

print(ans_ac, ans_wa)



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

ac = 0
wa = 0

hist_ac = [0] * N
hist_wa = [0] * N
for _ in range(M):
    p, s = input().split()
    p = int(p) - 1
    if hist_ac[p] == 0:
        if s == 'AC':
            hist_ac[p] = 1
            ac += 1
            wa += hist_wa[p]
        else:
            hist_wa[p] += 1

print(ac, wa)
Buggy python submission (verdict: Runtime Error):
import math

A, B = map(int, input().split())

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(A, B))


Fixed submission:
A = int(input())
B = int(input())

print(6 - A - B)
Buggy python submission (verdict: Runtime Error):
#%%
import math

A, B = map(int, input().split())

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

ans = lcm(A, B)
print(ans)


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

def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a

def lcm(x, y):
    return (x * y) // gcd(x, y)

ans = lcm(A, B)
print(int(ans))

Buggy python submission (verdict: Runtime Error):
import math

A, B = map(int, input().split())

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(A, B))


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

def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a

def lcm(x, y):
    return (x * y) // gcd(x, y)

ans = lcm(A, B)
print(int(ans))

Buggy python submission (verdict: Runtime Error):
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

A, B = map(int, input().split())

print(lcm(A, B))


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

def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a

def lcm(x, y):
    return (x * y) // gcd(x, y)

ans = lcm(A, B)
print(int(ans))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
N = int(input())
a_list = list(map(int, input().split())) #[3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 1]

ans = 0
value = 1


try:
    idx = a_list.index(value)
    ans += a_list.index(1)
    a_list = a_list[idx:]
    value += 1
except:
    print(-1)
    sys.exit(0)

while True:
    try:
        idx = a_list.index(value)
        ans += idx - 1
        a_list = a_list[idx:]
        value += 1
    except:
        ans += len(a_list) - 1
        break

print(ans)

Fixed submission:
import sys
N = int(input())
a_list = list(map(int, input().split())) #[3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 1]

try:
    idx = a_list.index(1)
except:
    print(-1)
    sys.exit(0)

#idx = 0
value = 1

for k, v in enumerate(a_list):
    if idx <= k and value+1 == v:
        value += 1

print(len(a_list) - value)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n = int(input())
L = list(map(int, input().split()))

#%%
ans = 0
for c in itertools.combinations(L, 3):
    if (c[0] < c[1] + c[2]) and (c[1] < c[0] + c[2]) and (c[2] < c[0] + c[1]):
        ans += 1

print(ans)


Fixed submission:
import bisect
n = int(input())
L = list(map(int, input().split()))
#%%
L.sort()

ans = 0
for i in range(n-2): # aを固定
    for j in range(i+1, n-1): # bを固定
        ab = L[i] + L[j]
        idx = bisect.bisect_left(L, ab, lo=j)
        ans += max(idx - (j+1), 0)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = sum(range(n))
print(ans)

Fixed submission:
n = int(input())
ans = n * (n-1)//2
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
n = int(input())

cnt = 0
anas = [Counter(input())]

for _ in range(n-1):
    _s = Counter(input())
    for a in anas:
        if a == _s:
            cnt += 1

    anas.append(_s)

print(cnt)

Fixed submission:
from collections import Counter
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

n = int(input())
anas = [''.join(sorted(input())) for _ in range(n)]
c = Counter(anas)


cnt = 0
for v in c.values():
    if v < 2:
        continue
    else:
        cnt += cmb(v, 2)

print(cnt)
Buggy python submission (verdict: Runtime Error):
import itertools
n, m = map(int, input().split())
ks = [list(map(int, input().split())) for _ in range(m)]
p = list(map(int, input().split()))

#%%
cnt = 0
for bits in itertools.product([0, 1], repeat=n):
    # ライトの配列の初期化
    lights = [0] * m

    # 電球ごとのONになってるスイッチの数をカウント
    # スイッチのindexでループを回す
    for i in range(n):
        if bits[i] == 1: #スイッチがONのとき
            sw = i + 1 # スイッチの番号
            for j in range(len(ks)): # 全部のlight-switchの配線を確認
                if sw in ks[j][1:]: # 配線がつながってるとき
                    lights[j] += 1 # そのlightに1を加算

    # カウント終了後条件判別
    # 一つもスイッチがONになってないとライトが付きもしない
    # if 0 not in lights:
        # 2で割ったあまり
    m_lights = [l%2 for l in lights]
    if m_lights == p:
        cnt += 1

print(cnt)


Fixed submission:
a, p = map(int, input().split())
print((a*3 + p)//2)
Buggy python submission (verdict: Time Limit Exceeded):
import re
s = str(input())

total = len(s)

while True:
    s_new = re.sub('01|10', '', s)
    if s_new == s:
        break
    s = s_new

print(total - len(s))

Fixed submission:
s = str(input())

total = len(s)

zero = s.count('0')
one = s.count('1')

print(total - abs(zero-one))
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
X = list(map(int, input().split()))

X.sort()
if N >= M:
    ans = 0
else:
    x_diff = [X[i + 1] - X[i] for i in range(len(X) - 1)]
    for _ in range(N - 1):
        x_diff.remove(max(x_diff))
    ans = sum(x_diff)

print(ans)


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

X.sort()
if N >= M:
    ans = 0
else:
    x_diff = [xn - x for xn, x in zip(X[1:], X[:-1])] #[X[i + 1] - X[i] for i in range(len(X) - 1)]
    # for _ in range(N - 1):
    #     x_diff.remove(max(x_diff))
    x_diff.sort(reverse=True)
    ans = sum(x_diff[N-1:])

print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()

ans = 'No'
for _ in range(len(S)):
    if S == T:
        ans = 'Yes'
        break
    S = S[-1] + S[:-1]

print(ans)


Fixed submission:
from itertools import permutations
a_list = list(map(int, input().split()))

ans = 1000
for p in permutations(a_list):
    cost = abs(p[1] - p[0]) + abs(p[2] - p[1])
    ans = min(cost, ans)

print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
import math
N, K = map(int, input().split())
A = list(map(int, input().split()))

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

minimum = min(A)
count = 0
for i in range(N-K+1):
    if A[i+K] == [minimum] * K:
        count += 0

ans = math.ceil(N/K) - count
print(ans)

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

t = 1
while True:
    if 1 + t * (K - 1) >= N:
        break
    t += 1

print(t)
Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input().split())

l = list(range(a, b+1))
s_uni = set(l[:k]) | set(l[-k:])
for s in sorted(s_uni):
    print(s)

Fixed submission:
a, b, k = map(int, input().split())
#%%
a_s = set(list(range(a, min(b+1, a+k))))
b_s = set(list(range(max(a, b-k+1), b+1)))
s_uni = b_s | a_s
print(*sorted(s_uni), sep='\n')

Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
#%%
l = list(range(a, b+1))
s_uni = set(l[:k]) | set(l[-k:])
for s in s_uni:
    print(s)

Fixed submission:
a, b, k = map(int, input().split())
#%%
a_s = set(list(range(a, min(b+1, a+k))))
b_s = set(list(range(max(a, b-k+1), b+1)))
s_uni = b_s | a_s
print(*sorted(s_uni), sep='\n')

Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input().split())


l = list(range(a, b+1))
for i in l[:k]:
    print(i)
for i in l[-k:]:
    print(i)

Fixed submission:
a, b, k = map(int, input().split())
#%%
a_s = set(list(range(a, min(b+1, a+k))))
b_s = set(list(range(max(a, b-k+1), b+1)))
s_uni = b_s | a_s
print(*sorted(s_uni), sep='\n')
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

c = Counter(A)
ans = 0
for i, m in c.items():
    if m < i:
        ans += m
    else:
        ans += m - i
print(ans)

Fixed submission:
import collections

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

c = collections.Counter(a)

ans = 0
for i, m in c.items():
    if m < i:
        ans += m
    else:
        ans += m - i
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

ans = 0
for a in set(A):
    count = A.count(a)
    if count > a:
        ans += count - a
    elif count < a:
        ans += count

print(ans)

Fixed submission:
import collections

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

c = collections.Counter(a)

ans = 0
for i, m in c.items():
    if m < i:
        ans += m
    else:
        ans += m - i
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

ans = 0
for a in set(A):
    count = A.count(a)
    if count > a:
        ans += count - a
    elif count < a:
        ans += count

print(ans)



Fixed submission:
import collections

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

c = collections.Counter(a)

ans = 0
for i, m in c.items():
    if m < i:
        ans += m
    else:
        ans += m - i
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

A.sort()

ans = 0
while True:
    count = A.count(A[0])
    if count > A[0]:
        ans += count - A[0]
    elif count < A[0]:
        ans += count
    A = A[count:]
    if len(A) == 0:
        break

print(ans)

Fixed submission:
import collections

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

c = collections.Counter(a)

ans = 0
for i, m in c.items():
    if m < i:
        ans += m
    else:
        ans += m - i
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int, input().split()))


Ap = list(map(lambda x: x+1, A))
Am = list(map(lambda x: x-1, A))

ans = 0
for a in set(A):
    tmp = A.count(a) + Am.count(a) + Ap.count(a)
    ans = max(ans, tmp)

print(ans)

Fixed submission:
from collections import Counter
n = int(input())
A = list(map(int, input().split()))

c = Counter(A)

ans = 0
for k in c.keys():
    tmp = c[k-1] + c[k] + c[k+1]
    ans = max(ans, tmp)

print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = tuple(map(int, input().split()))

#%%
keys = set(A)
keys = sorted(keys, reverse=True)

if len(keys) == len(A) - 2:
    ans = 0
else:
    lengths = []
    for k in keys:
        num = A.count(k)
        if num >= 4 and len(lengths) == 0:
            lengths.append(k)
            lengths.append(k)
        elif num >= 2:
            lengths.append(k)

        if len(lengths) == 2:
            break

    ans = lengths[0] * lengths[1]

print(ans)

Fixed submission:
N = int(input())
A = sorted(list(map(int, input().split())), reverse=True)

lengths = []
for i in range(len(A) - 1):
    try:
        if A[i] == A[i+3] and len(lengths) == 0:
            lengths.append(A[i])
            lengths.append(A[i])
            break
    except:
        pass

    if (A[i] not in lengths) and (A[i] == A[i+1]):
        lengths.append(A[i])

    if len(lengths) == 2:
        break

try:
    ans = lengths[0] * lengths[1]
except:
    ans = 0

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

#%%
keys = set(A)
keys = sorted(keys, reverse=True)

lengths = []
for k in keys:
    num = A.count(k)
    if num >= 4 and len(lengths) == 0:
        lengths.append(k)
        lengths.append(k)
    elif num >= 2:
        lengths.append(k)

    if len(lengths) == 2:
        break

try:
    ans = lengths[0] * lengths[1]
except:
    ans = 0

print(ans)

Fixed submission:
N = int(input())
A = sorted(list(map(int, input().split())), reverse=True)

lengths = []
for i in range(len(A) - 1):
    try:
        if A[i] == A[i+3] and len(lengths) == 0:
            lengths.append(A[i])
            lengths.append(A[i])
            break
    except:
        pass

    if (A[i] not in lengths) and (A[i] == A[i+1]):
        lengths.append(A[i])

    if len(lengths) == 2:
        break

try:
    ans = lengths[0] * lengths[1]
except:
    ans = 0

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

S = [int(input()) for _ in range(N)]

ans = 0
# bit 全探索する
for bit in range(1 << N):
    sum = 0

    for i in range(N):
        # bit にi 番目のフラグが立っているかどうか
        if bit & (1 << i):
            # フラグが立っているならsumに加算する
            sum += S[i]

    if sum % 10 == 0:
        sum = 0
    ans = max(ans, sum)

print(ans)

Fixed submission:
N = int(input())

S = [int(input()) for _ in range(N)]

ans = sum(S)
if ans % 10 == 0: # 10の倍数の時
    min_s = float('inf')
    for s in S: # sの中から, 10の倍数でない、かつ最小のものを探してくる
        if s % 10 != 0:
            min_s = min(min_s, s)
    if min_s == float('inf'): # sの中に10の倍数でないものがなかったとき
        ans = 0
    else:
        ans -= min_s

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())

ans = 0
for x in range(K+1):
    for y in range(K+1):
        for z in range(K+1):
            if x + y + z == S:
                ans += 1

print(ans)

Fixed submission:
K, S = map(int, input().split())

ans = 0
for x in range(K+1):
    for y in range(K+1):
            z = S - x - y
            if K >= S - x - y and z >= 0:
                ans += 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = input()
a = 0
n = len(N)
NN = int(N)
for i in range(n):
    a += NN%10
    NN = NN//10
if a%9 == 0:
    print('Yes')
else:
    print('No')

Fixed submission:
N = list(input())
for i in range(len(N)):
    N[i] = int(N[i])
if sum(N)%9 == 0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
A = list(map(int,input().split()))
L = 0
R = max(A)
while R-L > 1:
    X = (L+R)/2
    m = 0
    for i in range(N):
        c = A[i]/X
        if c == int(c):
            m += int(c) - 1
        else:
            m += int(c)
    if m <= K:
        R = int(X)+1
    else:
        L = int(X)
print(int(R))

Fixed submission:
N,K = map(int,input().split())
A = list(map(int,input().split()))
L = 0
R = max(A)
while R-L > 0.001:
    X = (L+R)/2
    m = 0
    for i in range(N):
        c = A[i]/X
        if c == int(c):
            m += int(c) - 1
        else:
            m += int(c)
    if m <= K:
        R = X
    else:
        L = X
if int(R) - int(L) == 0:
    print(int(R)+1)
else:
    print(int(R))

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
A = list(map(int,input().split()))
L = 0
R = max(A)
while int(R)-int(L) > 0:
    X = (L+R)/2
    m = 0
    for i in range(N):
        c = A[i]/X
        if c == int(c):
            m += int(c) - 1
        else:
            m += int(c)
    if m <= K:
        R = X
    else:
        L = X
print(int(R)+1)


Fixed submission:
N,K = map(int,input().split())
A = list(map(int,input().split()))
L = 0
R = max(A)
while R-L > 0.001:
    X = (L+R)/2
    m = 0
    for i in range(N):
        c = A[i]/X
        if c == int(c):
            m += int(c) - 1
        else:
            m += int(c)
    if m <= K:
        R = X
    else:
        L = X
if int(R) - int(L) == 0:
    print(int(R)+1)
else:
    print(int(R))
Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
A = list(map(int,input().split()))
L = []
import numpy as np
for i in range(K,N+1):
    L.append(np.prod(A[i-K:i]))
for i in range(len(L)-1):
    if L[i] < L[i+1]:
        print('Yes')
    else:
        print('No')

Fixed submission:
N,K = map(int,input().split())
A = list(map(int,input().split()))
for i in range(K,N):
    if A[i-K] < A[i]:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
A = list(map(int,input().split()))
for i in range(1,N):
    A[i] *= A[i-1]
A = [1] + A
for i in range(K,N):
    if A[i]/A[i-K] < A[i+1]/A[i+1-K]:
        print('Yes')
    else:
        print('No')

Fixed submission:
N,K = map(int,input().split())
A = list(map(int,input().split()))
for i in range(K,N):
    if A[i-K] < A[i]:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
A = list(map(int,input().split()))
P = [1]
for i in range(len(A)):
    if i == 0:
        P.append(A[i])
        a = A[i]
    else:
        P.append(a*A[i])
        a *= A[i]
for i in range(K,N):
    if P[i]//P[i-K] < P[i+1]//P[i+1-K]:
        print('Yes')
    else:
        print('No')

Fixed submission:
N,K = map(int,input().split())
A = list(map(int,input().split()))
for i in range(K,N):
    if A[i-K] < A[i]:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
A = list(map(int,input().split()))
P = [1]
for i in range(len(A)):
    if i == 0:
        P.append(A[i])
    else:
        P.append(P[-1]*A[i])
L = []
for i in range(K,N+1):
    L.append(P[i]//P[i-K])


for i in range(len(L)-1):
    if L[i] < L[i+1]:
        print('Yes')
    else:
        print('No')

Fixed submission:
N,K = map(int,input().split())
A = list(map(int,input().split()))
for i in range(K,N):
    if A[i-K] < A[i]:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
Q = int(input())
L = []
for i in range(Q):
    B,C = map(int,input().split())
    L.append([B,C])
c = {}
for i in range(1,10002):
    c[i] = 0
for k in A:
    c[k] += 1
s = sum(A)
for i in range(Q):
    if c[L[i][0]] == 0:
        print(s)
    else:
        n = c[L[i][0]]
        c[L[i][1]] += n
        c[L[i][0]] = 0
        s += (L[i][1] - L[i][0])*n
        print(s)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
Q = int(input())
L = []
for i in range(Q):
    B,C = map(int,input().split())
    L.append([B,C])
c = {}
for i in range(1,100001):
    c[i] = 0
for k in A:
    c[k] += 1
s = sum(A)
for i in range(Q):
    if c[L[i][0]] == 0:
        print(s)
    else:
        n = c[L[i][0]]
        c[L[i][1]] += n
        c[L[i][0]] = 0
        s += (L[i][1] - L[i][0])*n
        print(s)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
A = sorted(A)
b = len(A) - len(list(set(A)))
c = 0
AA = []
for i in range(1,N):
    for j in range(i):
        if A[i] == A[i-1]:
            break
        elif A[i] % A[j] == 0:
            c += 1
            break
        elif j == i-1:
            AA.append(A[i])
if A[0] == A[1]:
    print(len(AA))
else:
    print(len(AA)+1)

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

s = A[-1]
p = [0 for _ in range(s+1)]
for i in A:
    p[i] += 1
    if p[i] > 1:
        continue
    for j in range(i*2,s+1,i):
        p[j] += 1
ans = 0
for i in A:
    if p[i] == 1:
        ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
A = sorted(A)
ans = 0
import heapq
heapq.heapify(A)
while A != []:
    a = heapq.heappop(A)
    ans += 1
    AA = []
    if A[0] == a:
        ans -= 1
    for i in range(len(A)):
        if not (A[i] % a == 0):
            AA.append(A[i])
    A = AA
print(ans)

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

s = A[-1]
p = [0 for _ in range(s+1)]
for i in A:
    p[i] += 1
    if p[i] > 1:
        continue
    for j in range(i*2,s+1,i):
        p[j] += 1
ans = 0
for i in A:
    if p[i] == 1:
        ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
ans = 0
import heapq
heapq.heapify(A)
while A != []:
    a = heapq.heappop(A)
    ans += 1
    AA = []
    if a in A:
        ans -= 1
    for i in range(len(A)):
        if not (A[i] % a == 0):
            AA.append(A[i])
    A = AA
print(ans)

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

s = A[-1]
p = [0 for _ in range(s+1)]
for i in A:
    p[i] += 1
    if p[i] > 1:
        continue
    for j in range(i*2,s+1,i):
        p[j] += 1
ans = 0
for i in A:
    if p[i] == 1:
        ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
ans = 1
for i in range(len(A)):
    ans *= A[i]
if ans > 10**18:
    print(-1)
else:
    print(ans)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
ans = 1
if 0 in A:
    print(0)
    exit()
for i in range(N):
    if ans <= 10**18:
        ans *= A[i]
    else:
        ans = -1
        break
if ans > 10**18:
    print(-1)
else:
    print(ans)
Buggy python submission (verdict: Runtime Error):
A,B = map(float,input().split())
ans = str(A*B)
if ans[-3] == '.':
    a = ans[0:len(ans) - 3]
    print(int(a))
else:
    a = ans[0:len(ans) - 2]
    print(int(a))

Fixed submission:
A,B = map(str,input().split())
a = int(A)
b = int(B[0])*100 + int(B[2])*10 + int(B[3])
print((a*b)//100)

Buggy python submission (verdict: Runtime Error):
A,B = map(float,input().split())
ans = A*B
if ans >= 1:
    ans = str(A*B)
    a = ans[0:len(ans)-2]
    print(int(a))
else:
    print(0)

Fixed submission:
A,B = map(str,input().split())
a = int(A)
b = int(B[0])*100 + int(B[2])*10 + int(B[3])
print((a*b)//100)
Buggy python submission (verdict: Time Limit Exceeded):
T = list(input())
ans = ''
for i in range(-1,-len(T)-1,-1):
    if T[i] == '?' and i == -1:
        T[i] = 'D'
    elif T[i] == '?':
        if T[i+1] == 'D':
            T[i] = 'P'
        else:
            T[i] = 'D'
for i in range(len(T)):
    ans += T[i]
print(ans)

Fixed submission:
T = list(input())
for i in range(len(T)):
    if T[i] == '?':
        T[i] = 'D'
print(''.join(T))