Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

import sys
def input():
	return sys.stdin.readline()[:-1]
from collections import deque
H, W, K = map(int, input().split())
sh, sw, gh, gw = map(int, input().split())
c = ["@" * (W+2)] + ["@" + input() + "@" for _ in range(H)] + ["@" * (W+2)]
INF = 10**7
dist = [[INF for _ in range(W+2)] for _ in range(H+2)]
dist[sh][sw] = 0
q = deque()
q.append(sh*(W+2)+sw)
DI = [1, 0, -1, 0]
DJ = [0, 1, 0, -1]
while q:
	l = q.popleft()
	i, j = l//(W+2), l%(W+2)
	for di, dj in zip(DI, DJ):
		for k in range(1, K+1):
			ii, jj = i+di*k, j+dj*k
			if c[ii][jj] == "." and dist[ii][jj] > dist[i][j]:
				dist[ii][jj] = dist[i][j] + 1
				if ii == gh and jj == gw:
					print(dist[ii][jj])
					sys.exit()
				q.append(ii*(W+2) + jj)
			else:
				break
print(-1)

### FIXED CODE ###

import sys
def input():
	return sys.stdin.readline()[:-1]
from collections import deque
H, W, K = map(int, input().split())
sh, sw, gh, gw = map(int, input().split())
c = ["@" * (W+2)] + ["@" + input() + "@" for _ in range(H)] + ["@" * (W+2)]
INF = 10**6+5
dist = [[INF for _ in range(W+2)] for _ in range(H+2)]
dist[sh][sw] = 0
q = deque()
q.append(sh*(W+2)+sw)
DI = [1, 0, -1, 0]
DJ = [0, 1, 0, -1]
while q:
	l = q.popleft()
	i, j = l//(W+2), l%(W+2)
	for di, dj in zip(DI, DJ):
		for k in range(1, K+1):
			ii, jj = i+di*k, j+dj*k
			if c[ii][jj] == "@":
				break
			if dist[ii][jj] <= dist[i][j]:
				break
			if dist[ii][jj] > dist[i][j] + 1:
				dist[ii][jj] = dist[i][j] + 1
				if ii == gh and jj == gw:
					print(dist[ii][jj])
					sys.exit()
				q.append(ii*(W+2) + jj)
print(-1)
### BUGGY CODE ###

import sys
input = sys.stdin.readline

n=int(input())
l=[]
i=1
ans=10000000000000
while i<n**(1/2):
    if n%i==0:
        ans=n//i+i-2
print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline

n=int(input())
l=[]
i=int(n**(0.5))+1
ans=0
while 1:
    if n%i==0:
        ans=n//i+i-2
        break
    i-=1
print(ans)
### BUGGY CODE ###

import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

def calc(i,j):
    ret = -float('inf')
    if j==0:
        return 0
    if (N-i+1)//2 < j:
        return ret
    else:
        if i <= N-1:
            ret = max(ret,A[i]+calc(i+2,j-1))
        if i+1 <= N-1:
            ret = max(ret,A[i+1]+calc(i+3,j-1))
        return max(ret,calc(i+2,j))


N = I()
A = LI()

s = sum(A)
cums = [A[0]]
for i in range(1,N):
    cums.append(cums[-1]+A[i])

if N%2 == 0:
    print(calc(0,N//2))
else:
    print(calc(0,N//2))

### FIXED CODE ###

import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

N = I()
A = LI()


if N%2 == 0:
    d = defaultdict(lambda:defaultdict(lambda:-float('inf')))
    d[0][1] = A[0]
    d[1][1] = max(A[0],A[1])
    for i in range(2,N):
        if i%2 == 0:
            for j in [i//2,i//2+1]:
                d[i][j] = max(d[i-2][j-1]+A[i],d[i-1][j])
        else:
            for j in [(i+1)//2]:
                d[i][j] = max(d[i-2][j-1]+A[i],d[i-1][j])
    print(d[N-1][N//2])
else:
    d = defaultdict(lambda:defaultdict(lambda:-float('inf')))
    d[0][1] = A[0]
    d[1][1] = max(A[0],A[1])
    for i in range(2,N):
        if i%2 == 0:
            for j in [i//2,i//2+1]:
                d[i][j] = max(d[i-2][j-1]+A[i],d[i-1][j])
        else:
            for j in [i//2,i//2+1]:
                d[i][j] = max(d[i-2][j-1]+A[i],d[i-1][j])
    a1 = d[N-1][N//2]
    n = 0
    for i in range(2,N,2):
        n += A[i]
    print(max(n,a1))
### BUGGY CODE ###

A,B,C,K = map(int,input().split())
lst = []
m = 0
for i in range(A) :
    if m >= K :
        break
    lst.append(1)
    m += 1
for i in range(B) :
    if m >= K :
        break
    lst.append(0)
    m+=1
for i in range(C) :
    if m >= K :
        break
    lst.append(-1)
    m+=1
print(sum(lst))

### FIXED CODE ###

A,B,C,K = map(int,input().split())
if K > A :
    M = K - A
    L = abs(M-B)
    print(A-L)
else :
    print(K)
### BUGGY CODE ###

N, W = map(int, input().split())
x = [tuple(map(int, input().split())) for _ in range(N)] 
dp = [[0] * (W + 1) for _ in range(N + 1)]

for i, (w, v) in enumerate(x, 1):
    dpi = dp[i]
    dpim = dp[i-1]    
    for j in range(1, W + 1):
        if w <= j:
            dpi[j] = max(dpim[j], dpim[j - w] + v)
        else:
            dpi[j] = dpim[j]

print(dp[-1][W])

### FIXED CODE ###

#import
#import math
#import numpy as np
#= int(input())
#= input()
N, W = map(int, input().split())
#= list(map(int, input().split()))
#= [input(), input()]

x = [list(map(int, input().split())) for _ in range(N)]

dp = [[0] * (W + 1) for _ in range(N + 1)]

for i in range(1, N + 1):
    for j in range(1, W + 1):
        dp[i][j] = dp[i - 1][j]
        if i != 0 and x[i - 1][0] <= j:
            dp[i][j] = max(dp[i][j], dp[i-1][j-x[i-1][0]] + x[i-1][1])

print(dp[-1][W])
### BUGGY CODE ###

# coding: utf-8
import sys
from collections import deque

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

# 左からgreedyに
N, D, A = lr()
monsters = []
for _ in range(N):
    x, h = lr()
    monsters.append((x, h))

monsters.sort()
bomb = deque()
answer = 0
for x, h in monsters:
    while bomb:
        if bomb[0][0] + D < x:
            bomb.popleft()
        else:
            break
    for place, time in bomb:
        h -= A * time
    if h > 0:
        t = -(-h//A)
        answer += t
        bomb.append((x + D, t))

print(answer)    


### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 7)

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, D, A = lr()
XH = [lr() for _ in range(N)]
XH.sort()

over = [N] * N # over[i]はi番目のモンスターを攻撃した時影響のないモンスターの最小値（最大はNで対象なし）
cur = 1
for i in range(N):
    while cur < N and XH[i][0] + D + D >= XH[cur][0]:
        cur += 1
    over[i] = cur

damage = 0 # 今までの累計のダメージ数　(影響のないダメージは引く)
reset = [0] * (N+1) # これ以降関係のないダメージ
answer = 0
for i in range(N):
    x, h = XH[i]
    damage -= reset[i]
    h -= damage
    if h > 0:
        time = (h+A-1)//A
        answer += time
        damage += A * time
        reset[over[i]] += A * time

print(answer)
### BUGGY CODE ###

N,K = map(int,input().split())
h = list(map(int,input().split()))
dp = [0] * N
dp[0] = 0
for i in range(1,N):
    dp[i] = min([dp[i-j-1] + abs(h[i]-h[i-j-1]) for j in range(min(i,K))])

print(dp[-1])

### FIXED CODE ###

def main():
    N,K = map(int,input().split())
    A = list(map(int,input().split()))
    dp = [0] * (N+10)
    dp[2] = abs(A[1] - A[0])
    for i in range(2,N):
        res = []
        if K > i:
            kk = i+1
        else:
            kk = K + 1
        for j in range(1,kk):
            res.append(abs(A[i] - A[i-j])+dp[i-j+1])
        dp[i+1] = min(res)
    
    print(dp[N])
if __name__ == "__main__":
    main()
### BUGGY CODE ###

def main():
    N, K = list(map(int, input().split(' ')))
    Ai = list(map(int, input().split(' ')))
    # print(Ai)
    P = []
    prev = 0
    now = 0
    for i, n in enumerate(range(K-1, N)):
        # P.append(sum(Ai[n-K+1:n+1]))
        
        if i > 0:
            # print('a', n)
            prev = now
            now = sum(Ai[n-K+1:n+1])
            # print(now, prev)
            if now > prev:
                print('Yes')
            else:
                print('No')
        else:
            # print('b', n)
            now = sum(Ai[n-K+1:n+1])
            
            
    # # print(P)
    # for i in range(len(P)-1):
    #     if P[i+1] > P[i]:
    #         print('Yes')
    #     else:
    #         print("No")
        

main()

### FIXED CODE ###

N, K = map(int, input().split())
A = list(map(int, input().split()))
 
for i in range(N - K):
  score_2 = A[i+K]
  score_1 = A[i]
  print('Yes' if score_1 < score_2 else 'No')
### BUGGY CODE ###

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

ma = max(li)
cnts = []
for i in range(0, ma):
    cnt = li.count(i+1)
    cnt = str(cnt)
    cnts.append(cnt)

ans = '\n'.join(cnts)

if ma < n:
    ans += '\n' + '0\n'*(n-ma)
    print(ans)

else:
    print(ans)

### FIXED CODE ###

n = int(input())
list = list(map(int, input().split()))
data = [0] * n

for i in list:
    i -= 1
    data[i] += 1

for j in data:
    print(j)
### BUGGY CODE ###

from functools import lru_cache as cache

H, W, D = map(int, input().split())
A = tuple(tuple(map(int, input().split())) for _ in range(H))

pos = [0] * (H * W + 1)

for i in range(H):
    for j in range(W):
        pos[A[i][j]] = (i, j)

def L1(p1, p2):
    return abs(p1[0] - p2[0]) + abs(p1[1] - p2[1])

costs = [-1] * (H * W + 1)

@cache(maxsize=None)
def solve(l, r):
    total = 0
    for i in range(l, r, D):
        if costs[i] == -1:
            costs[i] = L1(pos[i], pos[i + D])
        total += costs[i]
    return total

Q = int(input())
for _ in range(Q):
    print(solve(*map(int, input().split())))


### FIXED CODE ###

H, W, D = map(int, input().split())
A = tuple(tuple(map(int, input().split())) for _ in range(H))

pos = [0] * (H * W + 1)

for i in range(H):
    for j in range(W):
        pos[A[i][j]] = (i, j)

def L1(p1, p2):
    return abs(p1[0] - p2[0]) + abs(p1[1] - p2[1])

costs = []

for i in range(H * W + 1):
    costs.append(0 if i <= D else costs[i - D] + L1(pos[i - D], pos[i]))

Q = int(input())
for _ in range(Q):
    L, R = map(int, input().split())
    print(costs[R] - costs[L])
### BUGGY CODE ###

N = int(input())

ans = 0
for i in range(1, N+1):
    first = i
    n = N // i
    last = n * i
    ans += (first + last) * n // 2
print(ans)


### FIXED CODE ###

import math
N = int(input())

ans = 0
for i in range(1, N+1):
    first = i
    n = N // i
    last = n * i
    ans += (first + last) * n // 2
print(ans)
### BUGGY CODE ###

def main():
    import sys
    from collections import Counter
    N = int(sys.stdin.readline())
    A = list(map(int, sys.stdin.readline().split()))
    Q = int(sys.stdin.readline())
    BC = [tuple(map(int, sys.stdin.readline().split())) for _ in range(Q)]
    C = Counter(A)
    '''
    L = [0 for _ in range(10**5+1)]
    for key, value in C.items():
        L[key] = value
    '''
        
        
    for bc in BC:
        C[bc[1]] += C[bc[0]]
        C[bc[0]]= 0
        ans = 0
        for key, value in C.items():
            ans += key*value
        print(ans)
        



if __name__=='__main__':
    main()


### FIXED CODE ###

def main():
    import sys
    from collections import Counter
    N = int(sys.stdin.readline())
    A = list(map(int, sys.stdin.readline().split()))
    Q = int(sys.stdin.readline())
    BC = [tuple(map(int, sys.stdin.readline().split())) for _ in range(Q)]
    C = Counter(A)
    '''
    L = [0 for _ in range(10**5+1)]
    for key, value in C.items():
        L[key] = value
    '''
        
    ans = 0
    for bc in BC:
        C[bc[1]] += C[bc[0]]
        tmp = C[bc[0]]
        C[bc[0]]= 0
        #print(C)
        if ans == 0:
            for key, value in C.items():
                ans += key*value
        else:
            ans +=(bc[1]-bc[0])*tmp
        print(ans)
        



if __name__=='__main__':
    main()
### BUGGY CODE ###

import sys
N,Y = map(int,input().split())
ans = []
count = 0
for i in range(N+1):
    for k in range(N-i+1):
        for m in range(N+1-k-i):
            if 10000*i+5000*k+1000*m==Y and i+k+m==N:
                ans.append(i)
                ans.append(k)
                ans.append(m)
                count += 1
                print(str(ans[0])+" "+str(ans[1])+" "+str(ans[2]))
                sys.exit()
                
if count == 0:
    print("-1 -1 -1")

### FIXED CODE ###

N,Y=map(int,input().split())
for i in range(N+1):
    for j in range(N-i+1):
        if 10000*i+5000*j+1000*(N-i-j)==Y:
            print(i,j,(N-i-j))
            exit()
else:
    print("-1 -1 -1")
### BUGGY CODE ###

n = int(input())
c = list(input())
sc = list(reversed(c))
ans = 0
flg = True

r = 0
l = 0

if 'W' not in set(c) or 'R' not in set(c):
    flg = False


while(flg):


    for i in range(l, n):
        if not flg:
            break

        if c[i] == 'W':
            for j in range(r, n):
                if sc[j] == 'R':
                    if len(c) >= i+j+2:
                        c[i] = 'R'
                        c[-1*j-1] = 'W'
                        ans += 1
                        sc = list(reversed(c))
                        break
                    else:
                        flg = False
                        break

                else:
                    r += 1
        else:
            l += 1


print(ans)



### FIXED CODE ###

n = int(input())
c = list(input())
sc = list(reversed(c))
ans = 0
r = 0
flg  = False

if 'W' not in set(c) or 'R' not in set(c):
    print(ans)


else:
    for i in range(n):
        if flg:
            break
        if c[i] == 'W':
            for j in range(r, n):
                r += 1
                if sc[j] == 'R':
                    if n >= i+j+2:
                        c[i] = 'R'
                        c[-1*j-1] = 'W'
                        ans += 1
                        break
                    else:
                        flg = True
                        break

                
            

    print(ans)
### BUGGY CODE ###

import math

nummax=300000
MSall=sorted([7*x-1 for x in range(1,nummax/7)]+[7*x+1 for x in range(1,nummax/7)])
MSprime=[]
smax=math.sqrt(MSall[-1])
i=6
while i<=smax:
    for x in MSall:
        if x%i==0:
            MSall.remove(x)
    MSprime.append(i)
    i=MSall[0]
MSprime=MSprime+MSall

while(1):
    N=int(raw_input())
    if N==1:
        break
    else:
        ok=[]
        i=0
        while MSprime[i]<=N:
            if N%MSprime[i]==0:
                ok.append(MSprime[i])
            i=i+1
        print str(N)+': '+' '.join([str(x) for x in ok])

### FIXED CODE ###

import math

def checkifprime(NN):
    for i in range(len(MSprime)):
        if MSprime[i]>NN:
            break
        elif NN%MSprime[i]==0:
            return -1
    return NN


nummax=int(50000)
MSall=sorted([7*x-1 for x in range(1,nummax/7)]+[7*x+1 for x in range(1,nummax/7)])
MSprime=[]
smax=math.sqrt(nummax)
i=6
while i<=smax:
    for x in MSall:
        if x%i==0:
            MSall.remove(x)
    MSprime.append(i)
    i=MSall[0]
MSprime=MSprime+MSall

while(1):
    N=int(raw_input())
    if N==1:
        break
    else:
        ok=[]
        for i in range(len(MSprime)):
            if MSprime[i]>N:
            	break
            elif N%MSprime[i]==0:
                ok.append(MSprime[i])
                cifp=checkifprime(N/MSprime[i])
                if cifp>0 and cifp!=1:
                    ok.append(cifp)
        if len(ok)==0:
        	ok.append(N)
        ok.sort()
                
        print str(N)+': '+' '.join([str(x) for x in ok])
### BUGGY CODE ###

n=int(input())
p=tuple(map(float,input().split()))
dp=[[0.0]*(n+1) for _ in range(n+1)]
dp[0][0]=1.0
for i in range(1,n+1):
  for j in range(i+1):
    dp[i][j]=dp[i-1][j]*(1-p[i-1])
    if j>0:
      dp[i][j]+=dp[i-1][j-1]*p[i-1]
print(sum(dp[n][n//2+1:]))

### FIXED CODE ###

n=int(input())
p=tuple(map(float,input().split()))
dp=[[0.0]*(n+1) for _ in range(n+1)]
dp[0][0]=1.0
for i in range(1,n+1):
  for j in range(i+1):
    dp[i][j]=dp[i-1][j]*(1-p[i-1])
    if j>0:
      dp[i][j]+=dp[i-1][j-1]*p[i-1]
print(sum(dp[n][n//2+1:]))
### BUGGY CODE ###

# でつoO(YOU PLAY WITH THE CARDS YOU'RE DEALT..)
from collections import deque
import sys
def main(H, W, C, D, S):
    INF = 10**6
    dist = [[INF] * W for _ in range(H)]
    dist[D[0]][D[1]] = 0
    q = deque([D])
    while q:
        i, j = q.popleft()
        d = dist[i][j]
        for ni in range(i - 2, i + 2 + 1, 1):
            if not(0 <= ni < H): continue
            dni = dist[ni]
            sni = S[ni]
            for nj in range(j - 2, j + 2 + 1, 1):
                if 0 <= nj < W and sni[nj] == '.':
                    m = abs(ni - i) + abs(nj - j)
                    nd = d if m <= 1 else d + 1
                    if dni[nj] > nd:
                        dni[nj] = nd
                        q.append((ni, nj))

    ans = dist[C[0]][C[1]]
    print(ans if ans < INF else -1)


if __name__ == '__main__':
    input = sys.stdin.readline
    H, W = map(int, input().split())
    C = tuple(map(lambda x: int(x) - 1, input().split()))
    D = tuple(map(lambda x: int(x) - 1, input().split()))
    S = [list(input().rstrip()) for _ in range(H)]
    main(H, W, C, D, S)


### FIXED CODE ###

# でつoO(YOU PLAY WITH THE CARDS YOU'RE DEALT..)
from collections import deque
import sys
def main(H, W, C, D, S):
    INF = 10**6
    dist = [[INF] * W for _ in range(H)]
    di, dj = D
    dist[di][dj] = 0
    q = deque([(di, dj, 0)])
    while q:
        i, j, d = q.popleft()
        if d > dist[i][j]: continue
        for ni, nj in [(i - 1, j), (i + 1, j), (i, j - 1), (i, j + 1)]:
            if 0 <= ni < H and 0 <= nj < W and S[ni][nj] == '.':
                if dist[ni][nj] > d:
                    dist[ni][nj] = d
                    q.appendleft((ni, nj, d))
        for ni in range(i - 2, i + 2 + 1, 1):
            if not(0 <= ni < H): continue
            dni = dist[ni]
            sni = S[ni]
            for nj in range(j - 2, j + 2 + 1, 1):
                if 0 <= nj < W and sni[nj] == '.':
                    if dni[nj] > d + 1:
                        dni[nj] = d + 1
                        q.append((ni, nj, d + 1))

    ans = dist[C[0]][C[1]]
    print(ans if ans < INF else -1)


if __name__ == '__main__':
    input = sys.stdin.readline
    H, W = map(int, input().split())
    C = tuple(map(lambda x: int(x) - 1, input().split()))
    D = tuple(map(lambda x: int(x) - 1, input().split()))
    S = [list(input().rstrip()) for _ in range(H)]
    main(H, W, C, D, S)
### BUGGY CODE ###

N, K, Q = map(int, input().split())

def calc_sum(n):
    return n-1

points = [K] * N
for i in range(Q):
    A = int(input())
    points = list(map(calc_sum, points))
    points[A-1] += 1
    
for i in range(N):
    if points[i] <= 0:
        print("No")
    else:
        print("Yes")
        

### FIXED CODE ###

N, K, Q = map(int, input().split())
array = [0] * N

for i in range(Q):
    A = int(input())
    array[A-1] += 1

for i in range(0,N):
    if(Q - array[i] >= K):
        print("No")
    else:
        print("Yes")
### BUGGY CODE ###

X,Y,Z,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
sorted_abcsum = sorted([A[x] + B[y] + C[z] for x in range(X) for y in range(Y) for z in range(Z)],reverse=True)
for k in range(K):
    print(sorted_abcsum[k])

### FIXED CODE ###

X,Y,Z,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
asort,bsort,csort = sorted(A,reverse=True),sorted(B,reverse=True),sorted(C,reverse=True)
print(asort[0] + bsort[0] + csort[0])
already = [[0,0,0]]
x,y,z = 0,0,0
place_sum = []
check = []
for k in range(K - 1):
    if [x + 1,y,z] not in already and x + 1 < X:
        already.append([x + 1,y,z])
        place_sum.append([x + 1,y,z])
        check.append(asort[x + 1] + bsort[y] + csort[z])
    if [x,y + 1,z] not in already and y + 1 < Y:
        already.append([x,y + 1,z])
        place_sum.append([x,y + 1,z])
        check.append(asort[x] + bsort[y + 1] + csort[z])
    if [x,y,z + 1] not in already and z + 1 < Z:
        already.append([x,y,z + 1])
        place_sum.append([x,y,z + 1])
        check.append(asort[x] + bsort[y] + csort[z + 1])
    print(max(check))
    x,y,z = place_sum[check.index(max(check))][0],place_sum[check.index(max(check))][1],place_sum[check.index(max(check))][2]
    place_sum.pop(check.index(max(check)))
    check.remove(max(check))
### BUGGY CODE ###

from functools import reduce

def problem():
  N = int(input())
  xs = [int(x) for x in input().split()]

  for i in range(N):
    t = (x for j, x in enumerate(xs) if i != j)
    yield reduce(lambda acc, elem: acc ^ elem, t)

print(*problem())

### FIXED CODE ###

from functools import reduce

def problem():
  N = int(input())
  xs = [int(x) for x in input().split()]
  t = reduce(lambda acc, elem: acc ^ elem, xs)

  for i in range(N):
    yield (t ^ xs[i])

print(*problem())
### BUGGY CODE ###

N = int(input())
Result = []
for i in range(N):
    number = int(input())
    if  number in Result:
        Result.remove(number)
    else:
        Result.append(number)
print(len(Result))

### FIXED CODE ###

N = int(input())
Result = set()
for i in range(N):
    number = int(input())
    if  number in Result:
        Result.remove(number)
    else:
        Result.add(number)
print(len(Result))
### BUGGY CODE ###

N = int(input())
X_2 = input()
X_10 = int(X_2, 2)

y = X_2.count('1')

a = X_10%(y+1)
if y==1:
    b = 0
else:
    b = X_10%(y-1)

for i in range(N):
    if X_2[i] == '1' and y == 1:
        print(0)
        continue
    elif X_2[i] == '1':
        c = (2**(N-1-i))%(y-1)
        x = (b-c)%(y-1)
    else:
        c = (2**(N-1-i))%(y+1)
        x = (a+c)%(y+1)
    count = 1
    while x!=0:
        x %= bin(x)[2:].count('1')
        count += 1
    print(count)

### FIXED CODE ###

N = int(input())
X_2 = input()
X_10 = int(X_2, 2)

y = X_2.count('1')

a = X_10%(y+1)
if y==1:
    b = 0
else:
    b = X_10%(y-1)

for i in range(N):
    if X_2[i] == '1' and y == 1:
        print(0)
        continue
    elif X_2[i] == '1':
        x = (b-pow(2, N-1-i, y-1))%(y-1)
    else:
        x = (a+pow(2, N-1-i, y+1))%(y+1)
    count = 1
    while x!=0:
        x %= bin(x)[2:].count('1')
        count += 1
    print(count)
### BUGGY CODE ###

n,k=map(int,input().split())
a=[int(i) for i in input().split()]
k=min(k,41)

for j in range(k):
    b=[0 for i in range(n)]
    for i in range(n):
        l=max(0,i-a[i])
        r=min(n-1,i+a[i])
        b[l]+=1
        if r+1<n:
            b[r+1]-=1
    for i in range(1,n):
        b[i]+=b[i-1]
    a=b
print(" ".join(map(str,a)))

### FIXED CODE ###

n,k=map(int,input().split())
a=[int(i) for i in input().split()]
k=min(k,41)

for j in range(k):
    b=[0 for i in range(n)]
    for i in range(n):
        l=max(0,i-a[i])
        r=min(n-1,i+a[i])
        b[l]+=1
        if r+1<n:
            b[r+1]-=1
    for i in range(1,n):
      b[i]+=b[i-1]
    a=b
print(" ".join(map(str,a)))
### BUGGY CODE ###

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

for i in range(m):
    temp = list(map(int, input().split()))
    for j in range(temp[0]):
        a_sort[j] = max(a_sort[j],temp[1])
    a_sort = sorted(a_sort)

print(sum(a_sort))


### FIXED CODE ###

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

bc = []
for i in range(m):
    temp = list(map(int, input().split()))
    bc.append(temp)

bc_sorted = sorted(bc, key = lambda x:x[1], reverse = True)
temp = 0

for i in range(m):
    for j in range(temp,min(n,temp+bc_sorted[i][0])):
        if a_sort[j] < bc_sorted[i][1]:
            a_sort[j] = bc_sorted[i][1]
            temp += 1
        else:
            break

print(int(sum(a_sort)))