Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N,T = map(int,(list(input().split())))
cost = []
for i in range(N):
    c,t = map(int,(list(input().split())))
    if t<=T:
        cost.append(c)
print(min(cost))


Fixed submission:
N,T = map(int,(list(input().split())))
cost = 1001
for _ in range(N):
    c,t = map(int,(list(input().split())))
    if t<=T:
        cost=min(cost,c)
if cost == 1001:
    print('TLE')
else:
    print(cost)
Buggy python submission (verdict: Time Limit Exceeded):
import sys,math,collections,itertools
input = sys.stdin.readline

N,M=list(map(int,input().split()))
mn = M//N
ml = M%N
if ml == 0:
    print(mn)
    exit()
ans = 0
for i in range(mn+1,0,-1):
    if i < ans:
        break
    tmp = math.gcd(i,M-i*(N-1))
    ans = max(ans,tmp)
print(ans)


Fixed submission:
import sys,math,collections,itertools
input = sys.stdin.readline

N,M=list(map(int,input().split()))
mn = M//N
ml = M%N
if ml == 0:
    print(mn)
    exit()
ans = 0
for i in range(mn+1,0,-1):
    if i < ans:
        break
    tmp = math.gcd(i,M-i*(N-1))
    ans = max(ans,tmp)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys,math,collections,itertools
input = sys.stdin.readline

N,M=list(map(int,input().split()))
mn = M//N
ml = M%N
if ml == 0:
    print(mn)
    exit()
ans = 0
for i in range(1,mn+1):
    tmp = math.gcd(i,M-i*(N-1))
    ans = max(ans,tmp)
print(ans)


Fixed submission:
import sys,math,collections,itertools
input = sys.stdin.readline

N,M=list(map(int,input().split()))
mn = M//N
ml = M%N
if ml == 0:
    print(mn)
    exit()
ans = 0
for i in range(mn+1,0,-1):
    if i < ans:
        break
    tmp = math.gcd(i,M-i*(N-1))
    ans = max(ans,tmp)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys,math,collections,itertools
input = sys.stdin.readline

N,M=list(map(int,input().split()))
mn = M//N
ml = M%N
if ml == 0:
    print(mn)
    exit()
ans = 0
for i in range(1,mn+1):
    tmp = math.gcd(i,M-i*(N-1))
    ans = max(ans,tmp)
print(ans)


Fixed submission:
import sys,math,collections,itertools
input = sys.stdin.readline

N,M=list(map(int,input().split()))
mn = M//N
ml = M%N
if ml == 0:
    print(mn)
    exit()
ans = 0
for i in range(mn+1,0,-1):
    if i < ans:
        break
    tmp = math.gcd(i,M-i*(N-1))
    ans = max(ans,tmp)
print(ans)
Buggy python submission (verdict: Runtime Error):
A,B=list(map(int,input().split()))

if A*B in [4,6,9]:
  print('No')
else:
  print('Yes')
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    '

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

if A*B in [2,4,6]:
  print('No')
else:
  print('Yes')

Buggy python submission (verdict: Runtime Error):
if int(input())*int(input()) in [4,6,9]:
  print('No')
else:
  print('Yes')
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    '

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

if A*B in [2,4,6]:
  print('No')
else:
  print('Yes')
Buggy python submission (verdict: Runtime Error):
import sys,math,collections,itertools
input = sys.stdin.readline

H,W= list(map(int,input().split()))
a = [ list(map(int,input().split())) for _ in range(H)]
operation = []

#-奇数だったら右へずらしていく。偶数ならなにもしない-#
cnt = 0
for ih in range(H):
    for iw in range(W-1):
        if a[ih][iw]%2 == 0:
            continue
        else:
            a[ih][iw] -= 1
            a[ih][iw+1] += 1
            cnt += 1
            operation.append([ih+1,iw+1,ih+1,iw+2])
#-最右端を上から下まで-#
for ih in range(H-1):
    if a[ih][iw]%2 == 0:
        continue
    else:
        a[ih][W] -= 1
        a[ih][W+1] += 1
        cnt += 1
        operation.append([ih+1,W+1,ih+2,W+1])
print(cnt)
for ope in operation:
    print(*ope)


Fixed submission:
import sys,math,collections,itertools
input = sys.stdin.readline

H,W= list(map(int,input().split()))
a = [ list(map(int,input().split())) for _ in range(H)]
operation = []

#-奇数だったら右へずらしていく。偶数ならなにもしない-#
cnt = 0
for ih in range(H):
    for iw in range(W-1):
        if a[ih][iw]%2 == 0:
            continue
        else:
            a[ih][iw] -= 1
            a[ih][iw+1] += 1
            cnt += 1
            operation.append([ih+1,iw+1,ih+1,iw+2])
#-最右端を上から下まで-#
for ih in range(H-1):
    if a[ih][W-1]%2 == 0:
        continue
    else:
        a[ih][W-1] -= 1
        a[ih+1][W-1] += 1
        cnt += 1
        operation.append([ih+1,W,ih+2,W])
print(cnt)
for ope in operation:
    print(*ope)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

N,K = list(map(int,input().split()))
target =[]
i=3
x = i/2*K
while x <= 3*N:
    if x == int(x):
        target.append(int(x))
    i += 1
    x = i/2*K
count = 0
if K%2 == 0:
    A = list(range(K//2,N+1,K//2))
else:
    A = list(range(K,N+1,K))


for trg in target:
    for a in A:
        for b in range((a//K+1)*K-a,N+1,K):
            c = trg - a - b
            #print(a,b,c,target)
            if  0 < c <= N  and (b+c)%K == 0 and (c+a)%K ==0:
                #print(a,b,c)
                count += 1
print(count)


Fixed submission:
import sys
input = sys.stdin.readline
N,K=list(map(int,input().split()))
if K%2 == 0:
    A = list(range(K//2,N+1,K))
    B = list(range(K,N+1,K))
else:
    A = list(range(K,N+1,K))
    B = []
print(len(A)**3+len(B)**3)
Buggy python submission (verdict: Runtime Error):
import sys,math,collections,itertools
input = sys.stdin.readline

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

cnt = 0
if P[0] == 1:
    isFirstNum = 1
else:
    isFirstNum = 0
    cnt +=1

if P[-1] == N:
    isLastNum = 1
else:
    isLastNum = 0
    cnt +=1
    
isBefore = 0
isAfter = 0

P.remove(1)
P.remove(N)


for i in range(len(P)-1):
    if P[i]>P[i+1]:
        cnt += 1
        if N-P[i]<=P[i+1]-1:
            isAfter = 1
        else:
            isBefore = 1

ope = cnt+isBefore*isFirstNum+isAfter*isLastNum

print(ope)


Fixed submission:
import sys,math,collections,itertools
input = sys.stdin.readline

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

Q = [0]*(N)
for i in range(N):
    Q[P[i]-1]=i

cnt = 1
ans = 1
for i in range(N-1):
    if Q[i+1]>Q[i]:
        cnt += 1
    else:
        ans = max(ans,cnt)
        cnt = 1
ans = max(ans,cnt)
print(N-ans)

Buggy python submission (verdict: Runtime Error):
import sys,math,collections,itertools
input = sys.stdin.readline

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

cnt = 0
if P[0] == 1:
    isFirstNum = 1
else:
    isFirstNum = 0
    cnt +=1

if P[-1] == N:
    isLastNum = 1
else:
    isLastNum = 0
    cnt +=1
    
isBefore = 0
isAfter = 0

P.remove(1)
P.remove(N)


for i in range(len(P)-1):
    if P[i]>P[i+1]:
        cnt += 1
        if P[i]>N//2:
            isAfter = 1
        else:
            isBefore = 1

ope = cnt+isBefore*isFirstNum+isAfter*isLastNum

print(ope)


Fixed submission:
import sys,math,collections,itertools
input = sys.stdin.readline

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

Q = [0]*(N)
for i in range(N):
    Q[P[i]-1]=i

cnt = 1
ans = 1
for i in range(N-1):
    if Q[i+1]>Q[i]:
        cnt += 1
    else:
        ans = max(ans,cnt)
        cnt = 1
ans = max(ans,cnt)
print(N-ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys,collections
input = sys.stdin.readline

s = input().rstrip()
K = int(input())
ls = len(s)
cs = collections.deque()
for i in range(ls):
    for j in range(i+1,ls+1):
        cs.append(s[i:j])
os = sorted(cs)
count = 0
lis = []
for i in os:
    if i not in lis:
        lis.append(i)
        count +=1
    else:
        continue
    if count == K:
        print(i)
        exit()
    


Fixed submission:
import sys,collections
input = sys.stdin.readline

s = input().rstrip()
K = int(input())
ls = len(s)
cs = collections.deque()
for i in range(ls):
    for j in range(i+1,i+1+K):
        cs.append(s[i:j])
os = sorted(cs)
count = 0
lis = []
for i in os:
    if i not in lis:
        lis.append(i)
        count +=1
    else:
        continue
    if count == K:
        print(i)
        exit()

Buggy python submission (verdict: Time Limit Exceeded):
import sys,math,collections,itertools
input = sys.stdin.readline

s = input().rstrip()
K = int(input())
ls = len(s)
cs = collections.deque()
for i in range(ls):
    for j in range(i+1,ls+1):
        cs.append(s[i:j])
os = sorted(cs)
count = 0
lis = []
for i in os:
    if i not in lis:
        lis.append(i)
        count +=1
    else:
        continue
    if count == K:
        print(i)
        exit()
    

Fixed submission:
import sys,collections
input = sys.stdin.readline

s = input().rstrip()
K = int(input())
ls = len(s)
cs = collections.deque()
for i in range(ls):
    for j in range(i+1,i+1+K):
        cs.append(s[i:j])
os = sorted(cs)
count = 0
lis = []
for i in os:
    if i not in lis:
        lis.append(i)
        count +=1
    else:
        continue
    if count == K:
        print(i)
        exit()

Buggy python submission (verdict: Time Limit Exceeded):
import sys,math,collections,itertools
input = sys.stdin.readline

s = input().rstrip()
K = int(input())
ls = len(s)
cs = []
for i in range(ls):
    for j in range(i+1,ls+1):
        cs.append(s[i:j])
os = sorted(cs)
count = 0
lis = []
for i in os:
    if i not in lis:
        lis.append(i)
        count +=1
    else:
        continue
    if count == K:
        print(i)
        exit()
    


Fixed submission:
import sys,collections
input = sys.stdin.readline

s = input().rstrip()
K = int(input())
ls = len(s)
cs = collections.deque()
for i in range(ls):
    for j in range(i+1,i+1+K):
        cs.append(s[i:j])
os = sorted(cs)
count = 0
lis = []
for i in os:
    if i not in lis:
        lis.append(i)
        count +=1
    else:
        continue
    if count == K:
        print(i)
        exit()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import copy
input = sys.stdin.readline

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

for i in range(1,N+1):
    c = copy.copy(b)
    sum_c = 0
    del c[i]
    for j in range(1,len(c)):
        sum_c += abs(c[j]-c[j-1])
    print(sum_c)
    



Fixed submission:
import sys
import copy
input = sys.stdin.readline

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

sumb= 0
for i in range(1,len(b)):
    sumb += abs(b[i]-b[i-1])

for j in range(1,N+1):
    sumc = sumb
    sumc = sumc - abs(b[j+1]-b[j])-abs(b[j]-b[j-1])+abs(b[j+1]-b[j-1])
    print(sumc)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
N = int(input())
S = [input() for i in range(N)]
candi = []
for s in S:
    if s[0] == 'M' or s[0] == 'A' or s[0] == 'R' or s[0] == 'C' or s[0] == 'H':
        candi.append(s)
combi = list(itertools.combinations(candi,3))
counter  = 0
for i in combi:
    if i[0][0] != i[1][0] and  i[1][0] != i[2][0] and  i[0][0] != i[2][0]:
        counter += 1
print(counter)


Fixed submission:
import itertools
import collections
N = int(input())
S = [input() for i in range(N)]
candi = []
for s in S:
    if s[0] == 'M' or s[0] == 'A' or s[0] == 'R' or s[0] == 'C' or s[0] == 'H':
        candi.append(s[0])
col_s = collections.Counter(candi)
combi_s = itertools.combinations(list(col_s),3)
counter = 0 
for i in combi_s:
    counter += col_s[i[0]]*col_s[i[1]]*col_s[i[2]]
print(counter)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
N = int(input())
S = [input() for i in range(N)]
candi = []
for s in S:
    if s[0] == 'M' or s[0] == 'A' or s[0] == 'R' or s[0] == 'C' or s[0] == 'H':
        candi.append(s)
combi = list(itertools.combinations(candi,3))
counter  = 0
for i in combi:
    if i[0][0] != i[1][0] and  i[1][0] != i[2][0] and  i[0][0] != i[2][0]:
        counter += 1
print(counter)


Fixed submission:
import itertools
import collections
N = int(input())
S = [input() for i in range(N)]
candi = []
for s in S:
    if s[0] == 'M' or s[0] == 'A' or s[0] == 'R' or s[0] == 'C' or s[0] == 'H':
        candi.append(s[0])
col_s = collections.Counter(candi)
combi_s = itertools.combinations(list(col_s),3)
counter = 0 
for i in combi_s:
    counter += col_s[i[0]]*col_s[i[1]]*col_s[i[2]]
print(counter)
Buggy python submission (verdict: Runtime Error):
print('Odd' if eval(input().replace("",'*')%2) else 'Even')

Fixed submission:
print('Odd' if eval(input().replace(" ",'*'))%2 else 'Even')

Buggy python submission (verdict: Runtime Error):
print('Odd' if eval(input().replace("",*)%2) else 'Even')

Fixed submission:
print('Odd' if eval(input().replace(" ",'*'))%2 else 'Even')
Buggy python submission (verdict: Runtime Error):
import sys,math,collections,itertools
input = sys.stdin.readline

K=int(input())
A=list(map(int,input().split()))[::-1]

ans =2
for i in range(1,K):
    if A[i] >= A[i-1]*2:
        print(-1)
        exit()
    elif A[i-1]<=A[i]<A[i-1]*2:
        ans = A[i]
    elif A[i-1]>A[i]:
        ans = math.ceil(A[i-1]/A[i])*A[i]

print(ans,ans+A[i]-1)


Fixed submission:
import sys,math,collections,itertools
input = sys.stdin.readline

K=int(input())
A=list(map(int,input().split()))

min_child = 2
max_child = 2

for i in range(K-1,-1,-1):
    if math.ceil(min_child/A[i])>0 and math.floor(max_child/A[i])>0 and math.floor(max_child/A[i])-math.ceil(min_child/A[i])>=0:
        min_child = math.ceil(min_child/A[i])*A[i]
        max_child =math.floor(max_child/A[i])*A[i]+A[i]-1
    else:
        print(-1)
        exit()
print(min_child,max_child)
Buggy python submission (verdict: Runtime Error):
s = input()
pirnt(s[:3]+'7'+s[4:])

Fixed submission:
s = input()
print(s[:3]+'8'+s[4:])

Buggy python submission (verdict: Runtime Error):
s = input()
pirnt(s[0:3]+'7'+s[4:])

Fixed submission:
s = input()
print(s[:3]+'8'+s[4:])

Buggy python submission (verdict: Runtime Error):
s = input()
pirnt(s[0:3]='7'+s[4:])

Fixed submission:
s = input()
print(s[:3]+'8'+s[4:])
Buggy python submission (verdict: Runtime Error):
N = int(input())
d = list((int(input()) for _ in range(N)))
import pandas as pd
print(len(pd.DataFrame(d)[0].value_counts()))


Fixed submission:
N = int(input())
d = sorted(list((input()) for _ in range(N)))
count = 0
dum =""
for i in range(N):
    if d[i] != dum:
        dum = d[i]
        count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

A,B,C,D=list(map(int,input().split()))
if A+B == C+D:
    print('Balanced')
elif A+B ＞ C+D:
    print('Left')
else:
    print('Right')


Fixed submission:
import sys
input = sys.stdin.readline

A,B,C,D=list(map(int,input().split()))
if A+B == C+D:
    print('Balanced')
elif A+B > C+D:
    print('Left')
else:
    print('Right')
Buggy python submission (verdict: Time Limit Exceeded):
import bisect
N =int(input())
A =sorted(list(map(int,input().split())))
B =sorted(list(map(int,input().split())))
C =sorted(list(map(int,input().split())))
counter = 0
for i in range(len(A)):
    b_index = bisect.bisect(B,A[i])
    if b_index >= len(B):
        break
    b_diam = B[b_index]
    for j in range(b_index,len(B)):
        c_index = bisect.bisect(C,B[j])
        if c_index >= len(C):
            break
        counter += len(C)-c_index
print(counter)


Fixed submission:
import bisect
N =int(input())
A =sorted(list(map(int,input().split())))
B =sorted(list(map(int,input().split())))
C =sorted(list(map(int,input().split())))
counter = 0
for i in range(len(B)):
    #Bより小さいAの探索
    Ind_A = bisect.bisect_left(A,B[i])
    if A[Ind_A-1] == B[i]:
        Ind_A -= 1
    
    #Bより大きいCの探索
    Ind_C = bisect.bisect_right(C,B[i])
    num_C = len(C)-Ind_C
    counter += round(Ind_A*num_C)
    #print('B[i] =' +str(B[i]),end='')
    #print(' Ind_A =' +str(Ind_A),end='')
    #print(' Ind_C =' +str(Ind_C),end = '')
    #print(' num_C =' +str(num_C),end = '')    
    #print(' 総数 ' + str(Ind_A*num_C))
print(counter)
Buggy python submission (verdict: Time Limit Exceeded):
import collections

s = input()
slen = len(s)

sl = list(s)
sl_inv = list(s[::-1])
cnt = 0
while sl:
    if sl[0]== sl_inv[0]:
        sl.pop(0)
        sl_inv.pop(0)
    elif sl[0] == 'x' and sl_inv[0] !='x':
        sl.pop(0)
    elif sl[0] != 'x' and sl_inv[0] == 'x':
        cnt += 1
        sl_inv.pop(0)
    elif sl[0] != 'x' and sl_inv[0] != 'x' and sl[0]!=sl_inv[0]:
        print(-1)
        exit()
    if sl_inv ==[]:
        break
    #print(sl,sl_inv,cnt)
print(cnt+len(sl_inv))


Fixed submission:
import collections

s = input()
slen = len(s)

sl = collections.deque(list(s))
sl_inv = collections.deque(list(s[::-1]))
cnt = 0
while len(sl)>0:
    if sl[0]== sl_inv[0]:
        sl.popleft()
        sl_inv.popleft()
    elif sl[0] == 'x' and sl_inv[0] !='x':
        sl.popleft()
    elif sl[0] != 'x' and sl_inv[0] == 'x':
        cnt += 1
        sl_inv.popleft()
    elif sl[0] != 'x' and sl_inv[0] != 'x' and sl[0]!=sl_inv[0]:
        print(-1)
        exit()
    if len(sl_inv) ==0:
        break
    #print(sl,sl_inv,cnt)
print(cnt+len(sl_inv))

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

s = input()
slen = len(s)
swox = s.replace('x','')
swox_rev = swox[::-1]
if swox != swox_rev:
    print(-1)
else:
    sl = list(s)
    sl_inv = list(s[::-1])
    cnt = 0
    while sl:
        if sl[0]== sl_inv[0]:
            sl.pop(0)
            sl_inv.pop(0)
        elif sl[0] == 'x' and sl_inv[0] !='x':
            sl.pop(0)
        elif sl[0] != 'x' and sl_inv[0] == 'x':
            cnt += 1
            sl_inv.pop(0)
        if sl_inv ==[]:
            break
        #print(sl,sl_inv,cnt)
    print(cnt+len(sl_inv))


Fixed submission:
import collections

s = input()
slen = len(s)

sl = collections.deque(list(s))
sl_inv = collections.deque(list(s[::-1]))
cnt = 0
while len(sl)>0:
    if sl[0]== sl_inv[0]:
        sl.popleft()
        sl_inv.popleft()
    elif sl[0] == 'x' and sl_inv[0] !='x':
        sl.popleft()
    elif sl[0] != 'x' and sl_inv[0] == 'x':
        cnt += 1
        sl_inv.popleft()
    elif sl[0] != 'x' and sl_inv[0] != 'x' and sl[0]!=sl_inv[0]:
        print(-1)
        exit()
    if len(sl_inv) ==0:
        break
    #print(sl,sl_inv,cnt)
print(cnt+len(sl_inv))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
for ai in range(1,3500):
    for bi in range(1,3500):
        try:
            ci = N*ai*bi/(4*ai*bi-N*ai-N*bi)
        except:
            continue
        if ci == int(ci) and ci > 0:
            print(ai,bi,int(ci))
            exit()


Fixed submission:
N = int(input())
for ai in range(1,3500):
    for bi in range(1,3500):
        try:
            ci = N*ai*bi/(4*ai*bi-N*ai-N*bi)
        except:
            continue
        if ci == int(ci) and ci > 0:
            print(ai,bi,int(ci))
            exit()

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
if N%2==0:
    a=N//2
    b=N
    c=N
    print(a,b,c)
else:
    for ai in range(N//4,3500):
        for bi in range(N//4,3500):
            try:
                ci = N*ai*bi/(4*ai*bi-N*ai-N*bi)
                if ci == int(ci) and ci > 0:
                    print(ai,bi,int(ci))
                    exit()
            except:
                continue


Fixed submission:
N = int(input())
for ai in range(1,3500):
    for bi in range(1,3500):
        try:
            ci = N*ai*bi/(4*ai*bi-N*ai-N*bi)
        except:
            continue
        if ci == int(ci) and ci > 0:
            print(ai,bi,int(ci))
            exit()

Buggy python submission (verdict: Runtime Error):
N = int(input())
if N%2==0:
    a=N//2
    b=N
    c=N
    print(a,b,c)
else:
    for ai in range(N//4,3500):
        for bi in range(N//4,3500):
            ci = N*ai*bi/(4*ai*bi-N*ai-N*bi)
            if ci == int(ci) and ci > 0:
                print(ai,bi,int(ci))
                exit()
                


Fixed submission:
N = int(input())
for ai in range(1,3500):
    for bi in range(1,3500):
        try:
            ci = N*ai*bi/(4*ai*bi-N*ai-N*bi)
        except:
            continue
        if ci == int(ci) and ci > 0:
            print(ai,bi,int(ci))
            exit()
Buggy python submission (verdict: Runtime Error):
N = int(input())
seat = [0]*100000
for i in range(N):
    a,b = map(int,list(input().split()))
    for j in range(a,b+1):
        seat[j] = 1
print(sum(seat))


Fixed submission:
N = int(input())
seat = [0]*100000
for i in range(N):
    a,b = map(int,list(input().split()))
    for j in range(a,b+1):
        seat[j-1] = 1
print(sum(seat))

Buggy python submission (verdict: Runtime Error):
N = int(input())
seat = [0]*100000
for i in range(N):
    li,ri = map(int,input().split())
    for j in range(li,ri+1):
        seat[j] = 1
print(sum(seat))


Fixed submission:
N = int(input())
seat = [0]*100000
for i in range(N):
    a,b = map(int,list(input().split()))
    for j in range(a,b+1):
        seat[j-1] = 1
print(sum(seat))
Buggy python submission (verdict: Runtime Error):
N = int(input())
s = [0]*(10**6)
for i in range(N):
    a = int(input())
    s[a-1] += 1
    s[a-1] = s[a-1]%2
print(sum(s))


Fixed submission:
N = int(input())
dic_a = {}
for i in range(N):
    a= int(input())
    if a in dic_a:
        dic_a[a] +=1
        dic_a[a] = dic_a[a]%2
    else:
        dic_a[a] = 1
print(sum(list(dic_a.values())))

Buggy python submission (verdict: Runtime Error):
N = int(input())
s = [0]*10**6
for i in range(N):
    a = int(input())
    s[a-1] += 1
    s[a-1] = s[a-1]%2
print(sum(s))


Fixed submission:
N = int(input())
dic_a = {}
for i in range(N):
    a= int(input())
    if a in dic_a:
        dic_a[a] +=1
        dic_a[a] = dic_a[a]%2
    else:
        dic_a[a] = 1
print(sum(list(dic_a.values())))
Buggy python submission (verdict: Time Limit Exceeded):
import sys,math,collections,itertools
input = sys.stdin.readline

N,M,R=list(map(int,input().split()))
r=list(map(int,input().split()))
ABC = [[float('inf')]*(N+1) for _ in range(N+1)]
#条件のうち、重複経路は最短のみ残す
for _ in range(M):
    a,b,c = map(int,input().split())
    if ABC[a][b]>c:
        ABC[a][b]=c
        ABC[b][a]=c
#整理
road = [[] for _ in range(N+1)]
for i in range(1,N+1):
    for j in range(1,N+1):
        if ABC[i][j] != float('inf'):
            road[i].append((j,ABC[i][j]))
#各頂点間の最小距離
dist = [[float('inf')]*(N+1) for _ in range(N+1)]
q=collections.deque([])
q.append(1)
while q:
    now = q.popleft()
    for goto,cost in road[now]:
        if dist[now][goto]>cost:
            dist[now][goto] = cost
            dist[goto][now] = cost
            q.append(goto)

rotate = itertools.permutations(range(1,N+1))
ans = float('inf')
for rot in rotate:
    tmp = 0
    rset = set(r)
    for i in range(len(rot)-1):
        if tmp == 0 and rot[i] not in rset:
            break
        tmp +=dist[rot[i]][rot[i+1]]
        rset.discard(rot[i])
        rset.discard(rot[i+1])
        if tmp>ans:
            break
        if len(rset) == 0:
            ans = min(ans,tmp)
            break
print(ans)
        
        



Fixed submission:
import sys,math,collections,itertools
input = sys.stdin.readline

N,M,R=list(map(int,input().split()))
r=list(map(int,input().split()))
ABC = [[float('inf')]*(N+1) for _ in range(N+1)]
#条件のうち、重複経路は最短のみ残す
for _ in range(M):
    a,b,c = map(int,input().split())
    if ABC[a][b]>c:
        ABC[a][b]=c
        ABC[b][a]=c

#各頂点間の最小距離 Warshall-Floyd
dist = [[float('inf')]*(N+1) for _ in range(N+1)]
for k in range(1,N+1):
    for i in range(1,N+1):
        for j in range(1,N+1):
            ABC[i][j] = min(ABC[i][j],ABC[i][k] + ABC[k][j])

rotate = itertools.permutations(r)
ans = float('inf')
for rot in rotate:
    tmp = 0
    flag = 0
    for i in range(len(rot)-1):
        tmp +=ABC[rot[i]][rot[i+1]]
        if tmp>ans:
            flag = 1
            break
    if flag==0:
        ans = min(ans,tmp)
print(ans)