Harryxun/stf_run huggingface dataset:
N=int(input)
A=[[0]*(N+1),[0]*(N+1),[0]*(N+1)]
A[0]=list(map(int,input().split()))
A[1]=list(map(int,input().split()))

max_candidate=[]
x=0
y=0
ans=A[0][0]
for i in range(N):
  if A[y][x+1]>=A[y+1][x]:
    ans+=A[0][x+1]
    x+=1
  #下方向移動の方が値が大きい場合、最大値の候補としてリストに追加
  else:
    ans_can=ans
    for i in range(x,N):
      ans_can+=A[1][i]
    max_candidate.append(ans_can)
print(max(max_candidate))


### FIXED CODE ###

N=int(input())
A=[]
for i in range(2):
    A_ = list(map(int, input().split()))
    A.append(A_)
    A[i].append(0)
A.append([0]*(N+1))
# A=[[0]*(N+1),[0]*(N+1),[0]*(N+1)]
# A[0]=list(map(int,input().split()))
# A[1]=list(map(int,input().split()))

max_candidate=[]
x=0
y=0
ans=A[0][0]
for i in range(N):
  if A[y][x+1]>=A[y+1][x]:
    ans+=A[0][x+1]
    x+=1
  #下方向移動の方が値が大きい場合、最大値の候補としてリストに追加
  else:
    ans_can=ans
    for j in range(x,N):
      ans_can+=A[1][j]
    max_candidate.append(ans_can)
    ans+=A[0][x+1]
    x+=1
print(max(max_candidate))
n,p=map(int,input().split())

if n==1:
  print(p)
else:
  ans=1
  for i in range(1,int(p**(1/n))+2):
    tmp=i**n
    if (p>=tmp) and (p%tmp == 0):
     ans=i
    if(p<tmp):
      break
  print(ans)


### FIXED CODE ###

n=input()

ans=0
for i in range(len(n)):
  if n[i]=="2":
    ans+=1
print(ans)
N, T = map(int, input().split())
c, t = list(map(int, input().split()))

costs = []
for i in range(N):
  if t[i] <= T:
    costs.append(c[i])
    
print(min(costs))

### FIXED CODE ###

N, T = map(int, input().split())
cost = 10000

for i in range(N):
  c, t = map(int, input().split())
  if t <= T:
    cost = min(cost, c)
    
if cost == 10000:
  print('TLE')
else:
  print(cost)
n = int(input())
ans = 1
l = list(map(int,input().split()))
for i in range(n) :
    ans *= l[i]
if ans > 10**18 :
    print('-1')
else :
    print(ans)

### FIXED CODE ###

a,b = map(int,input().split())
print(a*b)
# -*- coding:utf-8 -*-
import sys, itertools

N = int(input())
Sn = sorted([int(input()) for i in range(N)])

total = sum(Sn)
if total % 10 != 0:
    print(total)
    sys.exit()

sub_set = set(Sn)
for i in range(2, N):
    comb = [sum(l) for l in itertools.combinations(Sn, i)]
    for c in comb:
        sub_set.add(c)

for sub in sorted(sub_set):
    if (total - sub) % 10 != 0:
        print(total - sub)
        break
else:
    print(0)


### FIXED CODE ###

# -*- coding:utf-8 -*-

n = input()
n = n.split(' ')
res = int(n[0]) + int(n[1])
if res > 9:
    print('error')
else:
    print(res)
import string


def count_changes(s, k, pool, prev=None):
    if k == 0:
        return 0, None, None
    t = s * k
    count = 0
    i = 0
    for cur in t:
        if cur == prev:
            count += 1
            prev = pool[i]
            i = (i + 1) % length
        else:
            prev = cur
    return count, i, prev


if __name__ == '__main__':
    s = input()
    k = int(input())
    pool = list(set(string.ascii_lowercase) - set(s))
    length = len(pool)
    print(count_changes(s, k, pool)[0])

### FIXED CODE ###

def count_changes(s, k, prev=None):
    count = 0
    for _ in range(k):
        for cur in s:
            if cur == prev:
                count += 1
                prev = None
            else:
                prev = cur
    return count, prev


if __name__ == '__main__':
    s = input()
    k = int(input())
    if len(set(s)) == 1:
      print((len(s) * k) // 2)
      exit()
    if k <= 10 ** 8:
        print(count_changes(s, k)[0])
    else:
        base_count, prev = count_changes(s, 3)
        d, rest = divmod(k, 3)
        res = base_count * d
        if rest:
            res += count_changes(s, rest, prev)[0]
        elif s[0] == prev:
            res += (d - 1)
        print(res)
print(K*"AKL")

### FIXED CODE ###

k=int(input())
print(k*"ACL")
X = input()
Y = input()
print(int(X+Y/2)

### FIXED CODE ###

X,Y = map(int,input().split())
print(X+Y//2)
N = int(input())
X = [int(x) for x in input().split()]
hp = []
dis = 0
for i in range(min(X),max(X) + 1):
  hp.append(dis)
  dis = 0
  for j in X:
    dis += (i - j) ** 2
hp.remove(0)
print(min(hp))

### FIXED CODE ###

N = int(input())
X = [int(x) for x in input().split()]
hp = []
dis = 0

for i in range(min(X), max(X) + 1):
  hp.append(dis)
  dis = 0
  for j in X:
    dis += (i - j) ** 2
if len(hp) == 1:
  print(0)
else:
  hp.remove(0)
  print(min(hp))
n = int(input())
s = input()


ans =0

for i in range(10):
    if str(i) in s:
        t = s[s.index(str(i))+1:]
        for j in range(10):
            if str(j) in s:
                u = t[t.index(str(j))+1:]
                for k in range(10):
                    if str(k) in u:
                        ans += 1
print(ans)


### FIXED CODE ###

n = int(input())
s = input()
ans =0
for i in range(10):
    if str(i) in s:
        t = s[s.index(str(i))+1:]
        for j in range(10):
            if str(j) in t:
                u = t[t.index(str(j))+1:]
                for k in range(10):
                    if str(k) in u:
                        ans += 1
print(ans)
def dfs_rec(start, cost, aa, bb, cc):
    use_index = []
    for i in range(aa.count(start)):
        use_index.append(aa.index(start))
    for i in range(bb.count(start)):
        use_index.append(bb.index(start))
    use_index = sorted(use_index)[::-1]
    # この点から行けるところがないとき
    if len(use_index) == 0:
        return
    for i in use_index:
        p = aa[i] if bb[i] == start else bb[i]
        DP_modoki[p-1] = cc[i] + cost
        aa.pop(i)
        bb.pop(i)
        cc.pop(i)
        dfs_rec(p, DP_modoki[p-1], aa, bb, cc)


# ダイクストラとDP?
#ある頂点pからKまでの最短距離のリストがあれば良い?
# 結局Q個その都度検索したほうが早いか?
# 意地悪なサンプルでTLEするかも
N = int(input())
a, b, c = [], [], []
for i in range(N-1):
    s1, s2, s3 = list(map(int, input().split()))
    a.append(s1)
    b.append(s2)
    c.append(s3)
Q, K = list(map(int, input().split()))
x, y = [], []
for i in range(Q):
    s1, s2 = list(map(int, input().split()))
    x.append(s1)
    y.append(s2)
# Kまでの最短距離が必要な頂点のリスト
keisan_list = list(set(x).intersection(set(y)))
# 0からN-1に注意
DP_modoki = [0 for _ in range(N)]

#ここからDP?→ではなく、深さ優先探索で全探索
# 閉路がないなら、辿っていけば最短距離?
dfs_rec(K, 0, a, b, c)
for i in range(Q):
    print(DP_modoki[x[i]-1] + DP_modoki[y[i]-1])


### FIXED CODE ###

import heapq

G = [{}]

def setNode(n):
  global G
  G = [{} for i in range(n)]
def solve(s, n):
  global G
  fixed = [None]*n
  q = []
  heapq.heappush(q, (0,s))
  while q:
    w,x = heapq.heappop(q)
    if fixed[x] is not None: continue
    fixed[x] = w
    for y in G[x]:
        if fixed[y] is None:
            heapq.heappush(q, (w + G[x][y], y))
  return fixed


n = int(input())
setNode(n)
for i in range(n-1):
  s,t,w = map(int,input().split())
  G[s-1][t-1] = w
  G[t-1][s-1] = w
Q, K = map(int, input().split())
dist = solve(K-1,n)
for i in range(Q):
    x, y = map(int,input().split())
    print(dist[x-1]+dist[y-1])
temp = str(input())
count = 0
 
for i in temp:
  if i == 'R':
    count = count + 1
    max_count = count
  else:
    if max_count < count:
      max_count = count
    count = 0
    
print(max_count)

### FIXED CODE ###

temp = str(input())
count = 0
max_count = 0 

for i in temp:
  if i == 'R':
    count = count + 1
    max_count = count
  else:
    if max_count < count:
      max_count = count
    count = 0
    
print(max_count)
a, b, c, d = map(int, input().split())

n1 = (a + d - 1) // d
n2 = (c + b - 1) // b

if n1 => n2:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

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

n1 = (a + d - 1) // d
n2 = (c + b - 1) // b

if n1 >= n2:
    print('Yes')
else:
    print('No')
a,b,n = map(int, input().split())

t=0
xx=0
l=[-1]*(b+1)
p=1
if n>=b and b>1:
   while t == 0 and xx <= n:
      xx += 1
      c=a*xx%b
      if l[c]==-1:
         l[c]=xx
      else:
         t=1
   while t>-1:

      if l[p]>-1:
         t=-2
         x=l[p]
      p+=1
else:
   x=n
print(a*x//b-a*(x//b))


### FIXED CODE ###


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


if n>=b-1:
    x=b-1
else:
    x=n
print(a*x//b-a*(x//b))
n = int(input())
aaa = list(map(int, input().split()))
bbb = sorted(list(enumerate(aaa, start=1)), key=itemgetter(1))
print(*map(itemgetter(0), bbb))

### FIXED CODE ###

from operator import itemgetter
n = int(input())
aaa = list(map(int, input().split()))
bbb = sorted(list(enumerate(aaa, start=1)), key=itemgetter(1))
print(*map(itemgetter(0), bbb))
a = input()
b = 0
for i in range(len(a)):
if a[i]==2:
b=b+1
else:
b=b
print(b)


### FIXED CODE ###

a = input()
a = str(a)
b = 0
for i in range(len(a)):
    if a[i]=="2":
        b=b+1
    else:
        b=b
print(b)
def marks_C():
    N, K = map(int, input().split())
    scores = tuple(map(int, input().split()))

    for i, k in enumerate(range(K, N)):
     
        if calc_score(scores[i + 1:k + 1]) > calc_score(scores[i:k]):
            print('Yes')
        else:
            print('No')
     
     
def calc_score(score: tuple):
    total = 1
    for i in score:
        total *= i
     return total
     
     
if __name__ == '__main__':
    marks_C()

### FIXED CODE ###

def Kyu_in_atcoder():
    score = int(input())
    if score >= 1800:
        print(1)
    elif score >= 1600:
        print(2)
    elif score >= 1400:
        print(3)
    elif score >= 1200:
        print(4)
    elif score >= 1000:
        print(5)
    elif score >= 800:
        print(6)
    elif score >= 600:
        print(7)
    elif score >= 400:
        print(8)


def main():
	Kyu_in_atcoder()


if __name__ == '__main__':
    main()
str = list(input())
last = str[0]
check = 0
ans = 0

while True:
    check = 0
    last = str[0]
    for j in range(len(str) - 1):
        if j >= len(str):
            break

        if last != str[j + 1 - check]:
            str.pop(j-check)
            str.pop(j-check)
            check += 1
            ans += 2

        if str == []:
            break
        last = str[j + 1 - check]

    if check == 0:
        break
    if str == []:
        break

print(ans)


### FIXED CODE ###

str = list(input())
one = str.count("1")
zero = str.count("0")

print(min(one, zero)*2)
# coding: utf-8
# Your code here!
s=list(input())
count=0

for i in range(len(s)):#偶数ならグー　奇数ならパーになる
    if s[i]=='g':
        s[i]=0
    else:
        s[i]=1
    print(s)
    if i&1^s[i]==1 and i&1==1:
        count+=1
    elif i&1^s[i]==1 and s[i]&1==1:
        count-=1
    else:
        pass

print(count)



### FIXED CODE ###

# coding: utf-8
# Your code here!
s=list(input())
count=0

for i in range(len(s)):#偶数ならグー　奇数ならパーになる
    if s[i]=='g':
        s[i]=0
    else:
        s[i]=1
    if i&1^s[i]==1 and i&1==1:
        count+=1
    elif i&1^s[i]==1 and s[i]&1==1:
        count-=1
    else:
        pass

print(count)
N = int(input(""))
d = 0
for a in range(N):
  for b in range(N):
    for c in range(N):
      if a*b+c == N:
        d += 1
print(d)

### FIXED CODE ###

S = input("")
if S[-1] == "s":
  print(S+"es")
else:
  print(S+"s")
n = int(input())
a = [map(int,input().split())]
h = 0
if n >= 2:
  for i in range(1,n):
    if a[i] < a[i-1]:
      h += a[i-1] - a[i]
  print(h)
if n = 1:
  print(0)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
 
total = 0
m = 0
 
for x in a:
  if m > x:
    total += m - x
  m = max(m,x)
  
print(total)
daw = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
S = input()
ind = daw.find(S)
print(7 - idx)


### FIXED CODE ###

daw = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
S = input()
idx = daw.index(S)
print(7 - idx)
for True:
    x,y=map(int,input().split())
    if x+y == 0:break
    if x>y:x,y=y,x
    print(x,y)

### FIXED CODE ###

while True:
    x,y=map(int,input().split())
    if x+y == 0:break
    if x>y:x,y=y,x
    print(x,y)
import math
N=int(input())
nmax = math.floor(math.sqrt(N))
Bdigimin = 10
for i in range(1,nmax):
	if N % i == 0:
		Bdigi = math.floor(math.log10(N/i))
		if Bdigimin > Bdigi:
			Bdigimin = Bdigi
print(int(Bdigimin+1))


### FIXED CODE ###

num = list(map(int, input().split()))
a = num[0] + num[1]
print(int(a%24))
i = 0
while True:
    i += 1
    n = input()
    if (n == 0): break
    print("Case " + str(i) + ": " + str(n))


### FIXED CODE ###

i = 0
while True:
    i += 1
    n = input()
    if (n == "0"): break
    print("Case " + str(i) + ": " + n)
#%%
import collections

n = int(input())
x = [0] * n
y = [0] * n
for i in range(n):
    x[i], y[i] = map(int, input().split())

l = []
for i in range(n):
    for j in range(n):
        tmp = str(x[i]-x[j]) + ' ' + str(y[i]-y[j])
        l.append(tmp)

c = collections.Counter(l)
a = (list(c.values())[1])
print(n-a)

### FIXED CODE ###

#%%
import collections

n = int(input())
x = [0] * n
y = [0] * n
for i in range(n):
    x[i], y[i] = map(int, input().split())

l = []
for i in range(n):
    for j in range(n):
        tmp = str(x[i]-x[j]) + ' ' + str(y[i]-y[j])
        l.append(tmp)

c = collections.Counter(l)
a = list(c.values())
#print(a)
a.sort(reverse=True)


if n == 1:
    print(1)
else:
    print(n-a[1])
a = [int(input()) for i in range(5)]
b = []
for i in range(5):
	x = a[i]%10
	if x != 0:
	    b.append(10 - x)
ans = 0
for u in a:
    ans += u // 10 * 10
ans += len(b) * 10
ans -= max(b)
print(ans) 

### FIXED CODE ###

a = [int(input()) for i in range(5)]
b = []
for i in range(5):
	x = a[i]%10
	if x != 0:
	    b.append(10 - x)
ans = 0
for u in a:
    ans += u // 10 * 10
ans += len(b) * 10
if len(b) != 0:
	ans -= max(b)
print(ans)
a=int(input())
b=int(input())
c=list(map(int,input().split()))
total=0
for i in range(2):
    d=2*c[i]
    e=2*abs(9-c[i])
    total+=min(d,e)
print(total)

### FIXED CODE ###

a=int(input())
b=int(input())
c=list(map(int,input().split()))
total=0
for i in range(a):
    d=2*c[i]
    e=2*abs(b-c[i])
    total+=min(d,e)
print(total)
flag_p = p[0]
flag_ac = 0
AC_sum = 0
WA_sum = 0
WA = 0

for i in range(M):

    if flag_p == p[i]:
        if S[i] == 0 and flag_ac == 0:
            WA += 1
            print("1!")
        elif S[i] == 1 and flag_ac == 0:
            AC_sum += 1
            WA_sum += WA
            WA = 0
            flag_ac = 1
            print("2!")
        print(flag_p)
            
    else:
        flag_p = p[i]
        flag_ac = 0
        WA_sum += WA
        WA = 0
        if S[i] == 0 and flag_ac == 0:
            WA += 1
            print("3!")
        elif S[i] == 1 and flag_ac == 0:
            AC_sum += 1
            WA_sum += WA
            flag_ac = 1
            print("4!")
        print(flag_p)

print(AC_sum, WA_sum)

### FIXED CODE ###

import sys

N, M = map(int, input().split())
if M == 0:
    print(0, 0)
    sys.exit()

p_S = []
for _ in range(M):
    p_S.append(input().split())
    
p = []
S = []


for i in range(M):
    p_S[i][0] = int(p_S[i][0])
    p_S[i][1] = int(p_S[i][1] =='AC')
    
p_S.sort(key=lambda x: x[0])

for i in range(M):
    p.append(p_S[i][0])
    S.append(p_S[i][1])

p = list(map(int, p))
S = list(map(int, S))

flag_p = p[0]
flag_ac = 0
AC_sum = 0
WA_sum = 0
WA = 0

for i in range(M):

    if flag_p == p[i]:
        if S[i] == 0 and flag_ac == 0:
            WA += 1
        elif S[i] == 1 and flag_ac == 0:
            AC_sum += 1
            WA_sum += WA
            flag_ac = 1
    else:
        flag_p = p[i]
        flag_ac = 0
        WA = 0
        if S[i] == 0 and flag_ac == 0:
            WA += 1
        elif S[i] == 1 and flag_ac == 0:
            AC_sum += 1
            WA_sum += WA
            flag_ac = 1

print(AC_sum, WA_sum)
import numpy as np

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


def taste(N, L):
    all = np.array([np.abs(L + i - 1) for i in range(1, N + 1)])
    return all

tastes = taste(N, L)
import numpy as np

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


def taste(N, L):
    all = np.array([np.abs(L + i - 1) for i in range(1, N + 1)])
    return all

tastes = taste(N, L)
all = tastes[np.min(tastes) != tastes]

re = np.sum(all)
print(re)
all = tastes[np.min(tastes) != tastes]

re = np.sum(all)
print(re)

### FIXED CODE ###

import numpy as np
 
 
def taste(N, L):
    all_abs = np.array([np.abs(L + i - 1) for i in range(1, N + 1)])
    all_base = np.array([L + i - 1 for i in range(1, N + 1)])
 
    return all_abs, all_base
 
N, L = map(int, input().split())
 
all_abs, all_base = taste(N, L)
 
N_1_all = all_base[np.min(all_abs) != all_abs]
 
re = np.sum(N_1_all)
print(re)
a = int(input())
li = list(map(int, input().split())
b = float()

for a in li:
    c = 0
	while a%2 == 0:
      a = a/2
      c += 1
    b = min(b,c)
print(b)
          

### FIXED CODE ###

n = int(input())
li = list(map(int, input().split()))
b = float('inf')
for a in li:
    c = 0
    while a%2 == 0:
      a = a/2
      c += 1
    b = min(b,c)
print(b)
import sys

def main():
#    a = int(sys.argv[1])
#    b = int(sys.argv[2])
#    c = int(sys.argv[3])
    a, b, c = map(int, input().split())
    result = c-(a-b)
    if result < 0:
        result = 0

    print(result)
    sys.exit(2)

if __name__ == "__main__":
    main()

### FIXED CODE ###

def main():
    a, b, c = map(int, input().split())
    result = c-(a-b)
    if result < 0:
        result = 0

    print(result)

if __name__ == "__main__":
    main()
h, n = map(int, input().split())

S = []
for _ in range(n):
    D = list(map(int, input().split()))
    S.append(D)

dic={}

def rec(magic, nokori,sum_mp):
    if nokori<=0:
        return sum_mp
    if magic >= n:
        return 10**9

    if str(magic)+"_"+str(nokori) in dic:
        return dic[str(magic)+"_"+str(nokori)]

    dmg = S[magic][0]
    mp  = S[magic][1]

    min_mp = min(
        rec(magic  ,nokori-dmg,sum_mp+mp), # use this magic, and check this magic again
        rec(magic+1,nokori-dmg,sum_mp+mp), # use this magic, and check next magic
        rec(magic+1,nokori,sum_mp       ), # don't use this magic, and check next magic
    )

    dic[str(magic)+"_"+str(nokori)] = min_mp
    return min_mp

print(rec(0,h,0))

### FIXED CODE ###

h, n = map(int, input().split())
s = []
for _ in range(n):
    D = list(map(int, input().split()))
    s.append(D)

dp = [[10**10 for i in range(h+1)] for j in range(n+1)]
dp[0][0] = 0

for i in range(n):
    dmg=s[i][0]
    mp=s[i][1]
    for j in range(h+1):
        dp[i+1][j] = min(dp[i+1][j],dp[i][j])
        dp[i+1][min(j+dmg,h)] = min(dp[i+1][min(j+dmg,h)], dp[i+1][j]+mp)

print(dp[-1][-1])
import math

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

result=int(a*b//math.gcd(a,b))
print(result)

### FIXED CODE ###

from fractions import gcd
a,b=map(int,input().split())

result=int(a*b//gcd(a,b))
print(result)
a, b, k = map(int, input().split())

for i, j in enumerate(range(k)):
    if i % 2 == 0:
        if a % 2 == 1:
            a = a - 1
        b = b + a // 2
        a = a // 2
    elif i % 2 == 1:
        if b % 2 == 1:
            b = b - 1
        a = a + b // 2
        b = b // 2

print(a, b)


### FIXED CODE ###

S = input()

if len(S) == 2:
    print(S)
else:
    print(S[::-1])
H, N = map(int, input().split())
A = map(int, input().split())
sum = 0

for val in A
	sum = sum + val

if sum >= H 
	print("Yes")
  
print("No")

### FIXED CODE ###

H, N = map(int, input().split())
A = map(int, input().split())
sum = 0

for val in A:
	sum = sum + val

if sum >= H:
	print("Yes")
else:  
	print("No")
def search(values,hp,vp,item):
	if not (0<=hp<len(values)): return
	if not (0<=vp<len(values[hp])): return
	if item!=values[hp][vp]: return
	values[hp][vp]=True
	search(values,hp-1,vp,item)
	search(values,hp+1,vp,item)
	search(values,hp,vp-1,item)
	search(values,hp,vp+1,item)

def solve(values):
	count=0
	for i in range(len(values)):
		for j in range(len(values[i])):
			if values[i][j] in ['@','#','*']:
				search(values,i,j,values[i][j])
				count+=1
	return count

def main():
	line,values=input(),list()
	while line!='0 0':
		H,W = list(map(int,line.strip().split(' ')))
		value = list()
		for _ in range(H):
			value.append(list(x for x in input().strip()))
		values.append(value)
		line = input()
	for value in values:
		print(solve(value))

if __name__=='__main__':
	main()

### FIXED CODE ###

# -*- coding: utf-8 -*-

import sys
sys.setrecursionlimit(10**6)

def search(field,hp,vp,item):
	if not (0<=hp<len(field)): return
	if not (0<=vp<len(field[hp])): return
	if item!=field[hp][vp]: return
	field[hp][vp]=True
	for dh,dv in [[0,1],[0,-1],[1,0],[-1,0]]:
		search(field,hp+dh,vp+dv,item)
#	search(field,hp-1,vp,item)
#	search(field,hp+1,vp,item)
#	search(field,hp,vp-1,item)
#	search(field,hp,vp+1,item)

def solve(field):
	count,valid_items=0,set(['@','#','*'])
	for i in range(len(field)):
		for j in range(len(field[i])):
			if field[i][j] in valid_items:
				search(field,i,j,field[i][j])
				count+=1
	return count

def main():
	line = input().strip()
	while line!='0 0':
		H,W = list(map(int,line.split(' ')))
		field = list()
		for _ in range(H):
			field.append(list(input().strip()))
		print(solve(field))
		line = input().strip()

if __name__=='__main__':
	main()
for x in range(N + 1):
    for y in range(N + 1 - x):
        if N - x - y >= 0 and 10000*x + 5000*y + 1000*(N - x - y) == Y:
            res = (x, y, N - x - y)
print(res[0], res[1], res[2])

### FIXED CODE ###

N, Y = map(int, input().split())
flag = 0
for num_so in range(N+1):
    if flag == 1:
        break
    for num_fs in range(N+1):
        num_ts = N - num_so - num_fs
        sum = num_ts * 10000 + num_fs * 5000 + num_so * 1000
        if flag == 1:
            break
        elif sum == Y and num_ts >= 0:
            print(num_ts, num_fs, num_so)
            flag = 1
            break

if flag == 0:
    print("-1 -1 -1")
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    a = [int(input()) for i in range(N)]

    check = [False] * (int(1e5) + 1)

    for i in a:
        check[i] = not(check[i])
    
    ans = 0
    for c in check:
        if c:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
import bisect
input = sys.stdin.readline

def main():
    N = int(input())
    a = [int(input()) for i in range(N)]

    nums = []

    for i in a:
        if len(nums) > 0:
            if i <= nums[-1]:
                ind = bisect.bisect_left(nums, i)
                if nums[ind] == i:
                    nums.pop(ind)
                else:
                    bisect.insort(nums, i)
            else:
                nums.append(i)
        else:
            nums.append(i)
    
    print(len(nums))


if __name__ == "__main__":
    main()
N, X = map(int, input().split())
L = list(map(int, input().split()))
D = 0
ans = 1

for i in range(N):
    D += L[i]
    if D <= X:
        ans += 1

print(ans)


### FIXED CODE ###

x, a = map(int, input().split())
if x < a:
  print(0)
else:
  print(10)
n=int(input())
k=[]
def a(i):
    if i==0:
        return 26
    else:
        return i
while n>26:
    k+=[chr(96+a(n%26))]
    if n%26==0:
        n=n//26-1
    else:
        n//=26
k+=[chr(96+a(n))]
print(z+1,"".join(k[::-1]))

### FIXED CODE ###

n=int(input())
k=[]
def a(i):
    if i==0:
        return 26
    else:
        return i
while n>26:
    k+=[chr(96+a(n%26))]
    if n%26==0:
        n=n//26-1
    else:
        n//=26
k+=[chr(96+a(n))]
print("".join(k[::-1]))
N, M = map(int, input().split())
H = list(map(int, input().split))
AB = [list(map(int, input().split)) for _ in range(M)]

neighbor_max_heights = [0] * N

for i in range(M):
    a, b = AB[i]
    neighbor_max_heights[b-1] = max(neighbor_max_heights[b-1], H[a-1])
    neighbor_max_heights[a-1] = max(neighbor_max_heights[a-1], H[b-1])

ans = 0
for j in range(N):
    if H[j-1] > neighbor_max_heights[j-1]:
        ans += 1
print(ans)

### FIXED CODE ###

N, M = map(int, input().split())
H = list(map(int, input().split()))
AB = [list(map(int, input().split())) for i in range(M)]


low_set = set()
appear_set = set()

for i in range(M):
    a, b = AB[i]
    if H[a-1] > H[b-1]:
        low_set.add(b)
    elif H[a-1] < H[b-1]:
        low_set.add(a)
    else:
        low_set.add(a)
        low_set.add(b)

ans_set = set(range(1, N+1)) - low_set
print(len(ans_set))