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

import sys
input = sys.stdin.readline
n,K = map(int,input().split())
a = list(map(int,input().split()))

for k in range(K):
    light = [0]*n
    st = [0]*n

    for i in range(n):
        if i - a[i] >= 0:
            light[i-a[i]] += 1
        else:
            light[0] += 1
        
        if i + a[i] + 1 <= n-1:
            light[i + a[i] + 1] -= 1

    st[0] = light[0]
    for i in range(1,n):
        st[i] = st[i-1] + light[i]    
    
    if st == a:
        for ans in st:
            print(ans, end = " ")
    
    a = st[::]
for ans in a:
    print(ans, end = " ")
        


### FIXED CODE ###

import sys
input = sys.stdin.readline
n,K = map(int,input().split())
a = list(map(int,input().split()))

for k in range(K):
    light = [0]*n
    st = [0]*n
    skip = True
    for i in range(n):
        if i - a[i] >= 0:
            light[i-a[i]] += 1
        else:
            light[0] += 1
        
        if i + a[i] + 1 <= n-1:
            light[i + a[i] + 1] -= 1

    st[0] = light[0]
    if st[0] < n-1:
        skip = False
    for i in range(1,n):
        st[i] = st[i-1] + light[i]
        if st[i] < min(n-1-i,i):
            skip = False
    
    if skip:
        if k < K-1:
            for _ in range(n):
                print(n,end =" ")
            exit()
        else:
            for ans in st:
                print(ans, end = " ")
            exit()
    a = st[::]
for ans in a:
    print(ans, end = " ")
### BUGGY CODE ###

N, K, Q = [int(i) for i in input().split()]
A = []
for i in range(Q):
    A.append(int(input())-1)

for i in range(N):
    score = K - Q + A.count(i)
#    print(score)
    if score > 0:
        print('Yes')
    else:
        print('No')


### FIXED CODE ###

N, K, Q = [int(i) for i in input().split()]

score = [K - Q] * N

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

for i in range(N):
    if score[i] > 0:
        print('Yes')
    else:
        print('No')
### BUGGY CODE ###

n=int(input())
A=[int(input()) for i in range(n)]
ans=[]
for i in range(n):
    if A[i] in ans:
        ans.remove(A[i])
    else:
        ans.append(A[i])
print(len(ans))

### FIXED CODE ###

N=int(input())
s=set()
for i in range(N):s^={input()}
print(len(s))
### BUGGY CODE ###

import math

def comb(n,r,m):
    if r == 0: return 1
    return math.factorial(n)*pow(f,m-2,m)*pow(math.factorial(n-r),m-2,m)

N,K,*a = map(int, open(0).read().split())
m = 1000000007
f = math.factorial(K-1)
a.sort()
ans = 0
if K == 1:
    print(0)
else:
    for i in range(1,N-K+2):
        ans = (ans + a[-i] * comb(N-i,K-1,m)) % m
    for i in range(1,N-K+2):
        ans = (ans - a[i-1] * comb(N-i,K-1,m)) % m
    print(ans)

### FIXED CODE ###

def memfact(a,m):
    temp = 1
    yield temp
    for i in range(1,a+1):
        temp = temp * i % m
        yield temp
def comb(n,r,m):
    if r == 0: return 1
    return memf[n]*pow(memf[r],m-2,m)*pow(memf[n-r],m-2,m)

N,K,*a = map(int, open(0).read().split())
m = 1000000007
memf = []
mfappend = memf.append
for x in memfact(N-1,m):
    mfappend(x)
a.sort()
ans = 0
if K == 1:
    print(0)
else:
    for i in range(1,N-K+2):
        ans = (ans + a[-i] * comb(N-i,K-1,m)) % m
    for i in range(1,N-K+2):
        ans = (ans - a[i-1] * comb(N-i,K-1,m)) % m
    print(ans)
### BUGGY CODE ###

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

def gcd_m(*args):
    a, b = args[0], args[1]
    for i in range(2, len(args)):
        a, b = gcd(a, b), args[i]

    return gcd(a, b)

log = {}
K = int(input())
sum_gcd = 0
for a in range(1, K+1):
    for b in range(1, K+1):
        for c in range(1, K+1):
            key = str(sorted([a, b, c]))
            if key in log:
                sum_gcd += log[key]
            else:
                result = gcd_m(a, b, c)
                sum_gcd += result
                log[key] = result
print(sum_gcd)


### FIXED CODE ###

from math import gcd

log = {}
K = int(input())
sum_gcd = 0
for a in range(1, K+1):
    for b in range(1, K+1):
        for c in range(1, K+1):
            sum_gcd += gcd(gcd(a, b), c)
print(sum_gcd)
### BUGGY CODE ###

# @author 

import sys

class NSlimes:
    def solve(self):
        n = int(input())
        a = [None] + [int(_) for _ in input().split()]

        dp = [[float('inf')] * (n + 1) for _ in range(n + 1)]
        for i in range(1, n + 1):
            dp[i][i] = 0
        for i in range(n + 1, 0, -1):
            for j in range(1, n + 1):
                for k in range(i, j):
                    dp[i][j] = min(dp[i][k] + dp[k + 1][j] + sum(a[p] for p in range(i, j + 1)), dp[i][j])

        print(dp[1][n])


        # Greedy, not working

        # b = a[:]
        # ans = 0
        # for i in range(n - 1):
        #     idx = -1
        #     mn = float('inf')
        #     for j in range(n - 1 - i):
        #         if b[j] + b[j + 1] < mn:
        #             mn = b[j] + b[j + 1]
        #             idx = j
        #     assert(idx != -1)
        #     b[idx] += b[idx + 1]
        #     ans += b[idx]
        #     del b[idx + 1]
        # assert(len(b) == 1)
        # print(ans)

solver = NSlimes()
input = sys.stdin.readline

solver.solve()


### FIXED CODE ###

# @author 

import sys

class NSlimes:
    def solve(self):
        n = int(input())
        a = [None] + [int(_) for _ in input().split()]

        dp = [[float('inf')] * (n + 1) for _ in range(n + 1)]
        for i in range(1, n + 1):
            dp[i][i] = 0
        for i in range(n + 1, 0, -1):
            for j in range(1, n + 1):
                s = sum(a[p] for p in range(i, j + 1))
                for k in range(i, j):
                    dp[i][j] = min(dp[i][k] + dp[k + 1][j] + s, dp[i][j])

        print(dp[1][n])


        # Greedy, not working

        # b = a[:]
        # ans = 0
        # for i in range(n - 1):
        #     idx = -1
        #     mn = float('inf')
        #     for j in range(n - 1 - i):
        #         if b[j] + b[j + 1] < mn:
        #             mn = b[j] + b[j + 1]
        #             idx = j
        #     assert(idx != -1)
        #     b[idx] += b[idx + 1]
        #     ans += b[idx]
        #     del b[idx + 1]
        # assert(len(b) == 1)
        # print(ans)

solver = NSlimes()
input = sys.stdin.readline

solver.solve()
### BUGGY CODE ###


import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))

S = []
for i in range(N):
    S.append(A.index(max(A))+1)
    A[A.index(max(A))] -= 100000

S.reverse()
for i in range(N):
    print(str(S[i]) + " ")


### FIXED CODE ###

N = int(input())
L = list(map(int, input().split()))

M = []

for i in range(len(L)):
    l = (L[i], i+1)
    M.append(l)

M = sorted(M)

for x in M:
    print(x[1])
### BUGGY CODE ###

n,k=map(int,input().split())
s=list(input())
l=0
c=0
for i in range(n):
    if s[i]==min(s):
        c+=1
        l=max(l,c)
    else:
        c=0
import sys
input=sys.stdin.readline
s.reverse()
if k>13:
    print(min(s)*n)
else:
    for i in range(min(k,13)):
        t=list(reversed(s))
        u=t+s
        uu=u[:n]
        for j in range(1,n+1):
            x=u[j:j+n]
            if uu>x:
                uu=x
        s=uu
    print("".join(s))


### FIXED CODE ###

n,k=map(int,input().split())
s=list(input())
l=0
c=0
for i in range(n):
    if s[i]==min(s):
        c+=1
        l=max(l,c)
    else:
        c=0
import sys
input=sys.stdin.readline
s.reverse()
if (2**(k-1))*l>n:
    print(min(s)*n)
else:
    for i in range(min(k,13)):
        t=list(reversed(s))
        u=t+s
        uu=u[:n]
        for j in range(1,n+1):
            x=u[j:j+n]
            if uu>x:
                uu=x
        s=uu
    print("".join(s))
### BUGGY CODE ###

def t():
    N = int(input())
    A = list(map(int, input().split()))
    T = 1
    for i in A:
        T *= i
    if T > 10 ** 18:
        print(-1)
    else:
        print(T)

t()

### FIXED CODE ###

def t():
    N = int(input())
    A = list(map(int, input().split()))
    T = 1
    if 0 in A:
        return 0
    for i in A:
        T *= i
        if T > 10 ** 18:
            return -1
    return T
print(t())
### BUGGY CODE ###

N, K = map(int, input().split())
h = [int(input()) for _ in range(N)]
h.sort()
H = []
for i in range(1, N):
    H.append(h[i] - h[i - 1])
ans = 10 ** 9
for i in range(N - 1):
    if i + K <= N:
        ans = min(ans, sum(H[i:i + K - 1]))
print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
h = [int(input()) for _ in range(N)]
h.sort()
H = []
for i in range(1, N):
    H.append(h[i] - h[i - 1])
ans = sum(H[0:K - 1])
tmp = ans
for i in range(N - 1):
    if i + K < N:
        tmp = tmp + H[i + K - 1] - H[i]
        ans = min(ans, tmp)
print(ans)
### BUGGY CODE ###

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

ans = 0
for i in range(N):
    ans += A[i] * sum(A[i+1:])

ans = ans % 1000000007

print(ans)

### FIXED CODE ###

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

ans = 0
S = sum(A)
for i in range(N):
    S -= A[i]
    ans += A[i] * S

ans = ans % (10**9+7)

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

s = input()
K = int(input())

substrings = set()

for i in range(len(s)):
    for j in range(i+1, len(s)+1):
        substrings.add(s[i:j])

substrings_list = sorted(list(substrings))
print(substrings_list[K-1])


### FIXED CODE ###

s = input()
K = int(input())
 
substrings = set()
 
for i in range(len(s)):
    for j in range(i+1, min(len(s)+1, i+K+1)):
        substrings.add(s[i:j])
 
substrings_list = sorted(list(substrings))
print(substrings_list[K-1])
### BUGGY CODE ###

import  fractions
from functools import reduce
import sys
input = sys.stdin.readline
def main():
    n=int(input())
    a=list(map(int,input().split()))
    tmp = lcm(*a)
    mod=10**9 + 7
    m=0
    ans=0
    for i in range(len(a)):
        v=a[i]
        m=tmp//v
        ans+=m%mod
    ans = ans % mod
    print(ans)

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


if __name__=='__main__':
    main()


### FIXED CODE ###

import  fractions
from functools import reduce
import sys
input = sys.stdin.readline
def main():
    n=int(input())
    a=list(map(int,input().split()))
    # tmp = lcm(*a)
    mod=pow(10,9) + 7
    m=0
    ans=0
    tmp = a[0]
    for i in range(1,len(a)):
        tmp = (tmp*a[i]) // fractions.gcd(tmp,a[i])
    
    for i,v in enumerate(a):
        m=tmp//v
        ans+=m
    ans = ans % mod
    print(ans)


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

x,y,z,k=map(int,input().split())
a=[int(i) for i in input().split()]
b=[int(i) for i in input().split()]
c=[int(i) for i in input().split()]


ab=[]

for i in a:
    for j in b:
        ab.append(i+j)
ab.sort()
ab.reverse()
ans=[]
for i in range(min(k,len(ab))):
    for j in c:
        ans.append(ab[i]+j)
ans.sort()
ans.reverse()

for i in range(k):
    print(ans[i])



### FIXED CODE ###

x,y,z,k=map(int,input().split())
a=[int(i) for i in input().split()]
b=[int(i) for i in input().split()]
c=[int(i) for i in input().split()]


ab=[]

for i in a:
    for j in b:
        ab.append(i+j)
ab.sort()
ab.reverse()
ans=[]
for i in range(min(k,len(ab))):
    for j in c:
        ans.append(ab[i]+j)
ans.sort()
ans.reverse()

for i in range(k):
    print(ans[i])
### BUGGY CODE ###

import sys
from heapq import heappush, heappop
input = sys.stdin.readline

def main():
    N, M = map(int, input().split())
    jobs = {}
    for _ in range(N):
        A, B = map(int, input().split())
        if A > M:
            continue
        if A in jobs.keys():
            jobs[A] = jobs[A] + [-B]
        else:
            jobs[A] = [-B]

    profit = 0
    days = jobs.keys()
    potential_jobs = []
    
    # M-1日後から今日まで遡る
    for elappsed_day in range(1, M+1):
        if elappsed_day in days:
            for job in jobs[elappsed_day]:
                heappush(potential_jobs, job)
        if len(potential_jobs) > 0:
            profit += heappop(potential_jobs)
            
    print(-profit)

if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
from heapq import heappush, heappop
input = sys.stdin.readline

def main():
    N, M = map(int, input().split())
    jobs = {}
    for _ in range(N):
        A, B = map(int, input().split())
        if A > M:
            continue
        if A in jobs.keys():
            jobs[A] += [-B]
        else:
            jobs[A] = [-B]

    profit = 0
    days = jobs.keys()
    potential_jobs = []
    
    # M-1日後から今日まで遡る
    for elappsed_day in range(1, M+1):
        if elappsed_day in days:
            for job in jobs[elappsed_day]:
                heappush(potential_jobs, job)
        if len(potential_jobs) > 0:
            profit += heappop(potential_jobs)
            
    print(-profit)

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

import sys
from collections import deque as dq
input = sys.stdin.readline
H, W, K = map(int, input().split())
x, y, u, v = map(int, input().split())
x -= 1
y -= 1
u -= 1
v -= 1
a = [list(input())[: -1] for _ in range(H)]
Q = dq([(0, x * W + y)])
inf = H * W + 1
dp = [inf] * (H * W)
dp[x * W + y] = 0
while len(Q):
  cost, t = Q.popleft()
  dp[t] = cost
  p = t // W
  q = t % W
  if (p, q) == (u, v):
    print(cost)
    exit(0)
  for i in range(1, K + 1):
    pp = p + i
    if pp in range(H):
      if a[pp][q] == "@": break
      if dp[pp * W + q] <= dp[t]: break
      #dp[pp * W + q] = dp[t] + 1
      Q.append((dp[t] + 1, pp * W + q))
  for i in range(1, K + 1):
    pp = p - i
    if pp in range(H):
      if a[pp][q] == "@": break
      if dp[pp * W + q] <= dp[t]: break
      #dp[pp * W + q] = dp[t] + 1
      Q.append((dp[t] + 1, pp * W + q))

  for i in range(1, K + 1):
    qq = q + i
    if qq in range(W):
      if a[p][qq] == "@": break
      if dp[p * W + qq] <= dp[t]: break
      #dp[p * W + qq] = dp[t] + 1
      Q.append((dp[t] + 1, p * W + qq))

  for i in range(1, K + 1):
    qq = q - i
    if qq in range(W):
      if a[p][qq] == "@": break
      if dp[p * W + qq] <= dp[t]: break
      #dp[p * W + qq] = dp[t] + 1
      Q.append((dp[t] + 1, p * W + qq))
print(-1)

### FIXED CODE ###

import sys
from collections import deque as dq
input = sys.stdin.readline
H, W, K = map(int, input().split())
x, y, u, v = map(int, input().split())
x -= 1
y -= 1
u -= 1
v -= 1
a = [list(input())[: -1] for _ in range(H)]
Q = dq([(0, x * W + y)])
inf = H * W + 1
dp = [inf] * (H * W)
dp[x * W + y] = 0
while len(Q):
  cost, t = Q.popleft()
  dp[t] = cost
  p = t // W
  q = t % W
  if (p, q) == (u, v):
    print(cost)
    exit(0)
  for i in range(1, K + 1):
    pp = p + i
    if pp in range(H):
      if a[pp][q] == "@": break
      if dp[pp * W + q] <= dp[t]: break
      if dp[pp * W + q] != inf: continue
      dp[pp * W + q] = dp[t] + 1
      Q.append((dp[t] + 1, pp * W + q))
  for i in range(1, K + 1):
    pp = p - i
    if pp in range(H):
      if a[pp][q] == "@": break
      if dp[pp * W + q] <= dp[t]: break
      if dp[pp * W + q] != inf: continue
      dp[pp * W + q] = dp[t] + 1
      Q.append((dp[t] + 1, pp * W + q))

  for i in range(1, K + 1):
    qq = q + i
    if qq in range(W):
      if a[p][qq] == "@": break
      if dp[p * W + qq] <= dp[t]: break
      if dp[p * W + qq] != inf: continue
      dp[p * W + qq] = dp[t] + 1
      Q.append((dp[t] + 1, p * W + qq))

  for i in range(1, K + 1):
    qq = q - i
    if qq in range(W):
      if a[p][qq] == "@": break
      if dp[p * W + qq] <= dp[t]: break
      if dp[p * W + qq] != inf: continue
      dp[p * W + qq] = dp[t] + 1
      Q.append((dp[t] + 1, p * W + qq))
print(-1)
### BUGGY CODE ###

N = int(input())
P = list(map(int,input().split()))

count = 1
for i in range(1,N):
    for p in range(i):
        if P[p] < P[i]:
            break
    else:
        count += 1

print(count)


### FIXED CODE ###

def main():
    N = int(input())
    P = list(map(int,input().split()))
    min_val = 2*10e5
    count = 1
    for i in range(1,N):
        if min_val > P[i-1]:
            min_val = P[i-1]
        if P[i] <= min_val:
            count += 1
    print(count)
if __name__ == '__main__':
    main()
### BUGGY CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import heapq

N, D, A = map(int, readline().split())
m = map(int,read().split())
XH = list(zip(m,m))
heapq.heapify(XH)
width = 2*D

ans = 0
while len(XH) != 0:
  xh_min = heapq.heappop(XH)
  # left + D の位置で攻撃する
  left = xh_min[0]
  right = left + width
  nAttack = (xh_min[1] + A - 1) // A
  ans += nAttack
  damage = nAttack * A
  target = []
  while len(XH) != 0:
    xh = heapq.heappop(XH)
    if xh[0] <= right:
      if xh[1] > damage:
        target.append(xh)
    else:
      heapq.heappush(XH, xh)
      break
  for t in target:
    heapq.heappush(XH, (t[0], t[1] - damage))
  
print(ans)


### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import heapq

N, D, A = map(int, readline().split())
m = map(int,read().split())
XH = list(zip(m,m))
heapq.heapify(XH)
width = 2*D

ans = 0
while len(XH) != 0:
  xh_min = heapq.heappop(XH)
  # left + D の位置で攻撃する
  left = xh_min[0]
  right = left + width
  nAttack = (xh_min[1] + A - 1) // A
  damage = nAttack * A
    
  target = []
  while len(XH) != 0:
    xh = heapq.heappop(XH)
    if xh[0] <= right:
      if xh[1] > damage:
        target.append(xh)
    else:
      heapq.heappush(XH, xh)
      break
  if len(XH) == 0:
    maxH = xh_min[1]
    if len(target):
      maxH = max(xh_min[1], max([t[1] for t in target]))
    nAttack = (maxH + A - 1) // A
    ans += nAttack
  else:
    ans += nAttack
    for t in target:
      heapq.heappush(XH, (t[0], t[1] - damage))
  
print(ans)
### BUGGY CODE ###

n, m = map(int, input().split())
a, b = [], []
for i in range(m):
  _, __ = map(int, input().split())
  _ -= 1
  __ -= 1
  a.append(_)
  b.append(__)
  
# union-find

# 誰の肩に手を置いているか（先頭の場合は-1）
parent = [-1 for i in range(n)]

# 列車の深さ
depth = [0 for i in range(n)]

# kさんの「運転手」が誰かを調べる関数
def find_root(k):
  while parent[k] != -1:
    k = parent[k]
  return k 

for i in range(m):
  # a[i] と b[i] の合併
  root_a = find_root(a[i])
  root_b = find_root(b[i])
  
  # 浅い列車を持っている方が負けるようにする
  if depth[root_a] > depth[root_b]:
    root_a, root_b = root_b, root_a
  parent[root_a] = root_b
  depth[root_b] = max(depth[root_a]+1, depth[root_b])
  
group = [find_root(i) for i in range(n)]

from collections import Counter
print(Counter(group).most_common()[0][1])

### FIXED CODE ###

n, m = map(int, input().split())

# 隣接リストをつくる 
adj_list = [[] for i in range(n)]
for i in range(m):
  a, b = map(int, input().split())
  a -= 1
  b -= 1
  adj_list[a].append(b)
  adj_list[b].append(a)
  
# どの連結成分に属してるかを把握するための配列
group = [-1 for i in range(n)]

# 各頂点 i から探索をする
for i in range(n):
  if group[i] != -1: continue
  # i から DFS
  newly_visited = [i]
  group[i] = i
  while len(newly_visited) > 0:
    now = newly_visited.pop()
    for j in adj_list[now]:
      if group[j] != -1: continue
      newly_visited.append(j)
      group[j] = i

hist = [0 for i in range(n)]
for g in group:
  hist[g] += 1
print(max(hist))
### BUGGY CODE ###

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

def intSqrt(n):
    M = int(n**0.5)

    while (M + 1)**2 <= n:
        M += 1

    for _ in range(4000):
        n *= 100
        M *= 10
        for add in range(0, 10)[:: -1]:
            if (M + add)**2 <= n:
                M += add
                break

    return M

if intSqrt(A) + intSqrt(B) < intSqrt(C):
    print('Yes')
else:
    print('No')


### FIXED CODE ###

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

def intSqrt(n):
    M = int(n**0.5)

    while (M + 1)**2 <= n:
        M += 1

    for _ in range(300):
        n *= 100
        M *= 10
        for add in range(0, 10)[:: -1]:
            if (M + add)**2 <= n:
                M += add
                break

    return M

A, B, C = intSqrt(A), intSqrt(B), intSqrt(C)

if abs(A + B - C) < 10 or A + B >= C:
    print('No')
else:
    print('Yes')
### BUGGY CODE ###

n = int(input())
A = list(map(int, input().split()))
ans = 0
mod = 10**9 + 7

for i in range(n):
    for j in range(i+1, n):
        ans += A[i]*A[j]
print(ans%mod)


### FIXED CODE ###

n = int(input())
A = list(map(int, input().split()))
ans = 0
mod = 10**9 + 7

s = sum(A)

for a in A:
    s -= a
    ans += a * s

print(ans%mod)
### BUGGY CODE ###

N, K = map(int,input().split())
p = list(map(int,input().split()))
count = 0
MaxSum = 0
for i in p:
    tmp_slice = p[count:count + K]
    if MaxSum < sum(tmp_slice):
        MaxSum = sum(tmp_slice)
    count += 1 
print((MaxSum+K)/2)

### FIXED CODE ###

N, K = map(int,input().split())
p = tuple(map(int,input().split()))
MaxSum = sum(p[:K])
tmp_SumSlice = MaxSum
for i in range(K, N):
    tmp_SumSlice = tmp_SumSlice + p[i] - p[i - K]
    if MaxSum < tmp_SumSlice:
        MaxSum = tmp_SumSlice
print((MaxSum+K)/2)
### BUGGY CODE ###

import sys

n = int(sys.stdin.readline())
a_list = [int(x) for x in sys.stdin.readlines()]
card = []
for i in a_list:
    try:
        card.remove(i)
    except ValueError:
        card.append(i)
print(len(card))


### FIXED CODE ###

import sys
import collections

n = int(sys.stdin.readline())
a_list = [int(x) for x in sys.stdin.readlines()]
a_list_counter = collections.Counter(a_list)
count = 0
for i in a_list_counter:
    if a_list_counter[i] % 2 != 0:
        count += 1
    else:
        continue
print(count)
### BUGGY CODE ###

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

mo=10**9+7
an=0
wk=0
for i in range(n-1):
    for j in range(i+1,n):
        wk+=(a[j]%mo)
    an+=(a[i]*(wk%mo))%mo
    an%=mo
    wk=0
print(an)

### FIXED CODE ###

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

mo=10**9+7
an=0
wk=0
ru=[]
for i in a:
    wk+= i
    ru.append(wk%mo)
for i in range(n-1):
    an+=a[i]*(ru[n-1]-ru[i])
    an%=mo

print(an)
### BUGGY CODE ###

H, W = map(int, input().split())
Ch, Cw = map(int, input().split())
Dh, Dw = map(int, input().split())
S = [input() for _ in range(H)]
Ch -= 1
Cw -= 1
Dh -= 1
Dw -= 1

a = [(-1, 0), (1, 0), (0, -1), (0, 1)]
b = [(i % 5 - 2, i // 5 - 2) for i in range(25) if (i % 5 - 2, i // 5 - 2) not in a]

d = [[H * W] * W for _ in range(H)]
d[Ch][Cw] = 0
Q = {(Ch, Cw)}
while Q:
    h, w = Q.pop()
    for ah, aw in a:
        nh, nw = h + ah, w + aw
        if 0 <= nh < H and 0 <= nw < W and S[nh][nw] == ".":
            if d[nh][nw] > d[h][w]:
                d[nh][nw] = d[h][w]
                Q.add((nh, nw))
    for ah, aw in b:
        nh, nw = h + ah, w + aw
        if 0 <= nh < H and 0 <= nw < W and S[nh][nw] == ".":
            if d[nh][nw] > d[h][w] + 1:
                d[nh][nw] = d[h][w] + 1
                Q.add((nh, nw))

if d[Dh][Dw] == H * W:
    ans = -1
else:
    ans = d[Dh][Dw]
print(ans)



### FIXED CODE ###

from heapq import heappop, heappush

H, W = map(int, input().split())
Ch, Cw = map(int, input().split())
Dh, Dw = map(int, input().split())
S = [input() for _ in range(H)]
Ch -= 1
Cw -= 1
Dh -= 1
Dw -= 1

a = [(-1, 0), (1, 0), (0, -1), (0, 1)]
b = [(i % 5 - 2, i // 5 - 2) for i in range(25) if (i % 5 - 2, i // 5 - 2) not in a]

d = [[H * W] * W for _ in range(H)]
d[Ch][Cw] = 0
Q = [(0, Ch, Cw)]
while Q:
    now_d, h, w = heappop(Q)
    if now_d > d[h][w]:
        continue
    if (h, w) == (Dh, Dw):
        break
    for ah, aw in a:
        nh, nw = h + ah, w + aw
        if 0 <= nh < H and 0 <= nw < W and S[nh][nw] == ".":
            if d[nh][nw] > d[h][w]:
                d[nh][nw] = d[h][w]
                heappush(Q, (d[nh][nw], nh, nw))
    for ah, aw in b:
        nh, nw = h + ah, w + aw
        if 0 <= nh < H and 0 <= nw < W and S[nh][nw] == ".":
            if d[nh][nw] > d[h][w] + 1:
                d[nh][nw] = d[h][w] + 1
                heappush(Q, (d[nh][nw], nh, nw))

if d[Dh][Dw] == H * W:
    ans = -1
else:
    ans = d[Dh][Dw]
print(ans)