peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
n=int(input())
c=[0]*(n-1)
s=[0]*(n-1)
f=[0]*(n-1)
for i in range(n-1):
    c[i],s[i],f[i]=map(int,input().split())
for i in range(n-1):
    t=s[i]+c[i]
    for j in range(i+1,n-1):
        if t>=s[j]:
            t+=f[j]-t%f[j]+c[j]
        else:
            t=s[j]+c[j]
    print(t)
print('0')
# Judge status: Accepted
#coding:utf-8
w = input()

for i in range(len(w)):
    if w.count(w[i]) % 2 != 0:
        print('No')
        exit()

print('Yes')
# Judge status: Wrong Answer
n = int(input())

count = 0

for a in range(1, n):
  for b in range(1, n):
    if(a == b):
      count += 1
      break
    ah = str(a)[0]
    al = str(a)[-1]
    bh = str(b)[0]
    bl = str(b)[-1]
    if ah == bl and bh == al:
      count += 1
    
print(count)
# Judge status: Accepted
N = int(input())
keihin =[]
cnt = 0
for i in range(N):
    keihin.append(str(input()))

print(len(set(keihin)))
# Judge status: Accepted
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac
import fractions
from functools import reduce
from operator import mul
import bisect
import sys
import logging
import heapq
import itertools

logging.basicConfig(level=logging.ERROR)

input = sys.stdin.readline

setrecursionlimit(1000000)


def main():
	n = int(input())
	a = list(map(int,input().split()))
	d = defaultdict(int)
	for i in a:
		d[i-1] += 1
		d[i]   += 1
		d[i+1] += 1
	ans = -1
	for i in range(-1,max(a)+3):
		if(d[i] > ans):
			ans = d[i]
	print(ans)

main()
# Judge status: Accepted
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    a,b,c=MI()
    print(len(list(set([a,b,c]))))

main()
# Judge status: Accepted
x, y = list(map(int,input().split()))

a= [1,3,5,7,8,10,12]
b= [4,6,9,11]
c= [2]

if (x in a and y in a) or (x in b and y in b) or (x in c and y in c):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
from collections import Counter


N = int(input())
c = Counter(map(int, input().split()))
usables = sorted([(k, v) for k, v in c.items() if v >= 2])
if len(usables) <= 1:
    print(0)
else:
    if usables[-1][1] >= 4:
        print(usables[-1][0] ** 2)
    else:
        print(usables[-1][0] * usables[-2][0])
# Judge status: Accepted
n = int(input())

li = [int (i) for i in input().split()]

cnt = [0] * n

for i in li:
    cnt[i] += 1

ans = 1

for i in li[1:]:
    ans = ans*cnt[i-1]%998244353
if li[0] != 0:
    ans = 0

print(ans)
# Judge status: Accepted
S = input()
key = 'keyence'
ans = 'NO'
for i in range(7):
    f = key[:i]
    if S[:i] == f:
        if key[i:][::-1] == S[::-1][:7-i]:
            ans = 'YES'
            break
print(ans)
# Judge status: Accepted
n = int(input())
t, a = map(int,input().split())
h = list(map(int,input().split()))

atlist = []
for i in h:
    atlist.append(abs(a - (t - i * 0.006)))

print(atlist.index(min(atlist)) + 1)
# Judge status: Wrong Answer
import sys
def input():
    return sys.stdin.readline()[:-1]
a, b= input().split()
a = int(a)
b = int(b * 100)
output = a * b // 100
print(output)
# Judge status: Wrong Answer
n=int(input())
l=[]
for _ in range(n):
    a=int(input())
    l.append(a)
count=1
result=l[0]
f=-1
while n>0:
    result=l[result-1]
    if result==l[1]:
        f=count
    count+=1
    n-=1
print(f)
# Judge status: Accepted
a, b, x = map(int, input().split())
ans = "YES" if a <= x <= a + b else "NO"
print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))

ans = 0
m = 10**10
k = 0
for i in range(N):
    ans += abs(A[i])
    m = min(m,abs(A[i]))
    if A[i] < 0:
        k += 1

if k % 2 == 0:
    print(ans)
else:
    print(ans - 2*m)
# Judge status: Accepted
a,b,c,d = map(int,input().split())
print(max([a*c,a*d,b*c,b*d]))
# Judge status: Wrong Answer
X = int(input())

found = False
for a in range(-100, 100):
    if found: break;
    for b in range(-100, 100):
        if a ** 5 - b ** 5 == X:
            print(a, b)
            found = True
            break
# Judge status: Wrong Answer
import heapq

n, m = map(int, input().split())
a = list(map(int, input().split()))
ans = sum(a[min(n, m):])
a = [x*(-1) for x in a]
a = a[:min(n, m)]
heapq.heapify(a)

if len(a) == 1 and n == 1:
    print(a[0]//2**m)
elif len(a) == 1:
    print(a[0]//2**m+ans)
else:
    for i in range(m):
        c = (heapq.heappop(a)*(-1)//2)*(-1)
        heapq.heappush(a, c)
    print(ans-sum(a))
# Judge status: Accepted
x = int(input())

if x == 0:
    print(1)
elif x == 1:
    print(0)
# Judge status: Accepted
N=int(input())
A=list(map(int, input().split()))

MOD=7+10**9
SUM=sum(A)
ans=0

for i in range(N-1):
    SUM-=A[i]
    ans += A[i]*SUM %MOD
print(ans %MOD)
# Judge status: Wrong Answer
a = list(map(int, input().split()))
k = int(input())
a.sort()
print(a[0] + a[1] + a[2] * 2 * k)
# Judge status: Accepted
N=int(input())
a=input().split()
numbers=[]
for n in a:
    b=int(n)
    numbers.append(b)
a=round(sum(numbers)/N)
answers=[]
for z in numbers:
    y=(z-a)*(z-a)
    answers.append(y)
print(sum(answers))
# Judge status: Accepted
from collections import defaultdict

N = input()
counts = defaultdict(int)
values = set()
for a in map(int, input().split()):
    counts[a] += 1
    values.add(a)
ans = 0
for x in values:
    ans = max(ans, counts[x - 1] + counts[x] + counts[x + 1])
print(ans)
# Judge status: Wrong Answer
N,X,Y = map(int,input().split())

cut = Y-X -1

from collections import Counter
D = Counter()

for i in range(1,N):
    D[i] = N-i
    
for i in range(1,X+1):
    D[N-i] -= 1
    D[X-i + cut] +=1
    
for i in range(1,N):
    print(D[i])
# Judge status: Wrong Answer
N=int(input())
List=list(map(int,input().split()))
Q=int(input())
sum=0
Number=[]
Alphabet=[]
for i in range(Q):
    n,a=input().split()
    Number.append(int(n))
    Alphabet.append(int(a))
for i in range(N):
    sum+=List[i]
for i in range(Q):
    sum+=(List.count(Number[i]))*(Alphabet[i]-Number[i])
    print(sum)
# Judge status: Wrong Answer
Q, H, S, D = map(int, input().split())
N = int(input())

cQ = Q*4
cH = H*2
cS = S
cD = D / 2

m = min(cQ, cH, cS, cD)

if m == cQ:
    print(cQ * N)
elif m == cH:
    print(cH * N)
elif m == cS:
    print(cS * N)
else:
    if N % 2 == 0:
        print(D * N // 2)
    elif N == 1:
        print(min(cQ, cH, cS))
    else:
        c = (N-1)*cD
        print(int(c + min(cQ, cH, cS)))
# Judge status: Wrong Answer
x=int(input())
if x%9==0:
	print("YES")
else:
	print("NO")
# Judge status: Wrong Answer
def main():
    s = open(0).read()
    b = s.count('-')
    *c, = map(int, s[2:].replace('-', '').split())
    d = min(c)
    e = sum(c)
    
    if b % 2 == 0:
        print(e)
    else:
        print(e - 2 * d)


if __name__ == '__main__':
    main()
# Judge status: Accepted
S = input()

count = S.count("R")
if count == 2 and S[0] == "R" and S[2] == "R":
    count = 1
print(count)
# Judge status: Accepted
x,y=map(int, input().split( ))
if x%y==0:
	print(-1)
else:
  print(x)
# Judge status: Wrong Answer
l,  r,  d = map(int, input().split())
for  i in range(l, r):
    print(i % d)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
a = sorted([a[i]-i-1 for i in range(n)])
ans = 0
if n%2 == 0:
  b = a[n//2 - 1]
else:
  b = a[n//2]
for i in range(n):
  ans += abs(a[i] - b)
print(ans)
# Judge status: Accepted
N = int(input())
start, end, both = dict(), dict(), dict()
for i in range(1, N+1):
    i_s = str(i)
    l, r = int(i_s[0]), int(i_s[-1])
    both[l, r] = both.get((l, r), 0) + 1

ans = 0
for i in range(1, N + 1):
    i_s = str(i)
    l, r = int(i_s[0]), int(i_s[-1])
    ans += both.get((r, l), 0)
print(ans)
# Judge status: Accepted
s = list(input())
n = len(s)
temp = ['maerd', 'remaerd', 'esare', 'resare']
s.reverse()

i = 0
while i < n:
    flag = False
    for t in temp:
        if s[i:i+len(t)] == list(t):
            i += len(t)
            flag = True
            break

    if not flag:
        print("NO")
        exit()

print("YES")
# Judge status: Accepted
n, m = map(int, input().split())
x = list(map(int, input().split()))
if m < n:
  print(0)
  exit()
x.sort()
diff = []
for i in range(m-1):
  diff.append(x[i+1] - x[i] - 1)
diff.sort(reverse=True)
print(x[-1] - x[0] + 1 - sum(diff[:n-1]) - n)
# Judge status: Accepted
N = int(input())
T, A = map(int, input().split())
Hs = list(map(int, input().split()))

diff = list(map(lambda x: abs(A - (T - x * 0.006)), Hs))
idx = diff.index(min(diff))
print(idx + 1)
# Judge status: Accepted
sx,sy,tx,ty=map(int,input().split())
for i in range(sy,ty):
    print('U',end='')
for i in range(sx,tx):
    print('R',end='')
for i in range(sy,ty):
    print('D',end='')
for i in range(sx,tx):
    print('L',end='')
print('L',end='')
for i in range(sy,ty+1):
    print('U',end='')
for i in range(sx,tx+1):
    print('R',end='')
print('D',end='')
print('R',end='')
for i in range(sy,ty+1):
    print('D',end='')
for i in range(sx,tx+1):
    print('L',end='')
print('U',end='')
# Judge status: Accepted
def main():
    D, N = (int(i) for i in input().split())
    if N == 100:
        N += 1
    print(N*100**D)


if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())
k = int(input())
x = int(input())
y = int(input())
cost = 0
if n > k:
    for i in range(k):
        cost += x

    for j in range(k, n):
        cost += y
    print(cost)

elif n <= k:
    for i in range(n):
        cost += x
    print(cost)
# Judge status: Accepted
N = int(input())
s = []
Sum = 0
for i in range(N):
    s.append(int(input()))
    Sum += s[i]
s.sort()

if Sum % 10 != 0:
    print(Sum)
else:
    for i in range(N):
        if s[i] % 10 != 0:
            print(Sum - s[i])
            break
        if i == N - 1:
            print(0)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
if n == 0 and a[0] != 1:
    print(-1)
    exit(0)
b = [0] * (n + 2)
for i in range(n, 0, -1):
    b[i - 1] = b[i] + a[i]
t = 1 - a[0]
ans = 1
for i in range(n):
    m = min(t * 2, b[i])
    if m < a[i + 1]:
        print(-1)
        exit(0)
    ans += m
    t = m - a[i + 1]
print(ans)
# Judge status: Wrong Answer
s = input()
k = int(input())
flag = True

if len(s)==1:
    print(int(s))
    exit()

new = ''
for i in s:
    if i!='1':
        flag = False
        new += i

if flag:
    print(1)
else:
    print(new[0])
# Judge status: Wrong Answer
s = str(input())
result = ""


for i in range(len(s)):
    if s[i] == "0":
        result += "0"
    elif s[i] == "1":
        result += "1"
    else:
        if len(result) > 1:
            result = result[0:i-1]
        elif len(result) == 1:
            result = ""

print(result)
# Judge status: Accepted
a, b = map(int, input().split())
print(max(a + a - 1, a + b, b + b - 1))
# Judge status: Accepted
s = input()
t = input()
ans = ""

while len(t) > 0:
  ans += s[0] + t[0]
  s = s[1:]
  t = t[1:]
  
ans += s

print(ans)
# Judge status: Accepted
a, b, c, d = map(int, input().split())

if d <= a or b <= c:
  print(0)
elif c <= a and b <= d:
  print(b-a)
elif a <= c and b <= d:
  print(b-c)
elif c <= a and d <= b:
  print(d-a)
elif a <= c and d <= b:
  print(d-c)
else:
  print(0)
# Judge status: Accepted
s=set(list(input()))
ns=0
ew=0
if 'N' in s and 'S' in s:
  ns=1
elif 'N' not in s and 'S' not in s:
  ns=1

if 'E' in s and 'W' in s:
  ew=1
elif 'E' not in s and 'W' not in s:
  ew=1

if ns&ew:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n,m = map(int,input().split())
ab_list = [list(map(int,input().split())) 
           for nesya in range(m)]
city_list = [0]*n
for hoge in ab_list:
  a = hoge[0]
  b = hoge[1]
  city_list[a-1] += 1
  city_list[b-1] += 1
for city in city_list:
  print(city)
# Judge status: Wrong Answer
n,K = map(int,input().split())
p = min(n,K-1)
ans = 0
chk = [1]*(K-1)
k = K
for i in range(15):
  k /= 2
  if k == int(k):
    q = int(k*2-k-1)
  else:
    q = int(k*2-k)
  for i in range(q):
    chk[i] += 1
  if k <= 1:
    break
    
#print(chk)
for i in range(p):
  ans += float(1/(2**chk[i]*n))
  #print(ans)
ans += max(0,(n-K+1)/n)
print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
k = 0
for num in a:
  k = k^num
ans = []
for num2 in a:
  ans.append(str(k^num2))
print(' '.join(ans))
# Judge status: Accepted
x, y = map(int, input().split())
ans = 1
while x*2 <= y:
    ans += 1
    x *= 2
print(ans)
# Judge status: Accepted
s = input()

c0 = s.count("0")
c1 = s.count("1")

print(min([c0*2,c1*2]))
# Judge status: Accepted
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  #空白なし
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  #空白あり
def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし

A,V = map(int,S().split())
B,W = map(int,S().split())
T = I()

if V > W and T*abs(V-W) >= abs(A-B):
    print('YES')
else:
    print('NO')
# Judge status: Accepted
n = int(input())
l = list(map(int,input().split(" ")))
ans = 0

for i in range(n):
  for j in range(n):
    for k in range(n):
      if l[i] < l[j] & l[j] < l[k]:
        if l[i] != l[j] != l[k]:
          if l[i] + l[j] + l[k] > max(l[i],l[j],l[k])*2:
            ans += 1

print(ans)
# Judge status: Accepted
n = int(input())
h = list(map(int,input().split()))
ans = 0
now = 0
for i in range(n-1):
  if h[i] >= h[i+1]:
    now += 1
  else:
    ans = max(ans,now)
    now = 0
print(max(ans,now))
# Judge status: Wrong Answer
S, W = map(int, input().split())

if S < W:
    print('unsafe')
else:
    print('safe')
# Judge status: Accepted
oni = list(map(int, input().split()))
nige = list(map(int, input().split()))
time = int(input())

if nige[1]>=oni[1]:
    print("NO")
else:
    distance = abs(oni[0]-nige[0])
    diff = oni[1]-nige[1]
    need_time = distance / diff
    if need_time > time:
        print("NO")
    else:
        print("YES")
# Judge status: Accepted
import re
A,B=map(int,input().split())
S=input()
a,b,flg=S[0:A],S[-B:],True
if S[A]!="-" or re.match(".*[^0-9].*",a) or re.match(".*[^0-9].*",b):flg=False
print("Yes" if flg else "No")
# Judge status: Accepted
x, a, b = map(int, input().split())
print("A" if abs(x - a) < abs(x - b) else "B")
# Judge status: Wrong Answer
n,k=map(int,input().split())
p=list(map(int,input().split()))

ans=0
if n!=1:
    for i in range(k):
        min=p[i]
        for j in range(i+1,n):
            if min>p[j]:
                min=p[j]
                p[j]=p[i]
        ans+=min
else:
    ans=p[0]
print(ans)
# Judge status: Wrong Answer
A=[]
for i in [0]*3:
    A+=list(map(int,input().split()))
N=int(input())
B=[0]*9
for i in range(N):
    i=int(input())
    if i in A:
        B[A.index(i)]=1
res=0
for i in range(3):
    res+=B[i]*B[i+1]*B[i+2]
    res+=B[i]*B[i+3]*B[i+6]
res+=B[0]*B[4]*B[8]+B[2]*B[4]*B[6]
print(['No','Yes'][res>0])
# Judge status: Accepted
n = input()

a = 9*(len(n)-1)

b = 0
for i in n:
	b += int(i)

c = 0
for i in range(len(n)):
	if i == 0:
		c += int(n[i])-1
	else:
		c += 9
print (max(a,b,c))
# Judge status: Accepted
x = input().split()
N = int(x[0])
X = int(x[1])
Y = int(x[2])

L = [0 for _ in range(N+1)]

for i in range(1,N):
    for j in range(i+1,N+1):
        L[min(j-i,abs(X-i)+abs(Y-j)+1)] +=1
            
for k in range(1,N):
    print(L[k])
# Judge status: Wrong Answer
a,b=map(int,input().split())
if a+b >= 24:
  print(24-a-b)
else:
  print(a+b)
# Judge status: Wrong Answer
a, b = map(int, input().split())
if a <= 0 and b >= 0:
    print(0)
elif a > 0 and b > 0:
    print("Positive")
elif a < 0 and b < 0:
    if (b-a+1) % 2 == 0:
        print("Positive")
    else:
        print("Negative")
# Judge status: Wrong Answer
N, M = [int(i) for i in input().split()]

L = abs(N - M)

if L >= 2:
    print(0)
else:
    E = 2*N*M
    print(E)
# Judge status: Wrong Answer
import math

N,K=map(int,input().split())
L=list(map(int,input().split()))
M=min(L)
tmp=0
ans=float("inf")
for i in range(N):
	if L[i]==M:
		tmp=math.ceil(i/(K-1))
		tmp+=math.ceil((N-1-i)/(K-1))
		ans=min(ans,tmp)
print(ans)
# Judge status: Wrong Answer
n=map(int,input())
lst=len(set(map(int,input().split())))
if n==lst:
    print("YES")
else:  print("NO")
# Judge status: Wrong Answer
x,y=map(int,input().split())
from math import log2
print(1+int(0.01+log2(y/x)))
# Judge status: Wrong Answer
A, B, C = map(int, input().split())
if (A * B * C) % 2 == 0:
    ans = 0
    print(ans)
else:
    V = A*B*C
    AB = A*B
    BC = B*C
    CA = C*A
    ans = min(V-(A//2)*BC, V-((A//2) + 1)*BC)
    ans = min(V-(B//2)*CA, V-((B//2) + 1)*CA)
    ans = min(V-(C//2)*AB, V-((C//2) + 1)*AB)
    print(V - 2*ans)
# Judge status: Accepted

def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def sums(a, N): 
    ans = ((N//a)*((N//a)+1)//2)*a
    return ans 


def solve():
    N = read_int()
    return N*(N+1)//2-(sums(3, N)+sums(5, N)-sums(15, N)) 


if __name__ == '__main__':
    print(solve())
# Judge status: Accepted
s=[0,0,0]
s[0]=list(input())
s[1]=list(input())
s[2]=list(input())
n=0
for i in range(100000):
    if len(s[n])==0:
        break
    tmp=s[n].pop(0)
    if tmp=="a":
        n=0
    elif tmp=="b":
        n=1
    else:
        n=2

if n==0:
    print("A")
elif n==1:
    print("B")
else:
    print("C")
# Judge status: Accepted
child = int(input())

candy = 0

for i in range(child + 1):
    candy = candy + i

print(candy)
# Judge status: Wrong Answer
s = int(input())

def fn(n):

    if n % 2 == 0:
        return n // 2
    else:
        return 3 * n + 1
        
for i in range(1, 10**8):
    if i == 1:
        a = s
    else:
        a = fn(a)
    if a == 4:
        print(i+3)
        break
# Judge status: Accepted
n = int(input())
ws = [str(input()) for i in range(n)]
t = ws[0][0]
for w in ws:
  if ws.count(w) > 1:
    print('No')
    break
  if t[-1] != w[0]:
    print('No')
    break
  else:
    t = w
    n-=1
if n == 0:
  print('Yes')
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
x = a + b + c
if x <= 21:
  print("win")
else:
  print("burst")
# Judge status: Accepted
import itertools






from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))


def main():
    n = ii()
    a = list(range(1,n+1))
    p = li()
    q = li()
    pc = 0
    qc = 0
    for e,i in enumerate(itertools.permutations(a)):
        
        lli = list(i)
        if lli == p:
            pc = e

        if lli == q:
            qc = e

    print(abs(pc-qc))


    
main()
# Judge status: Wrong Answer
import math
x, y = map(int, input().split())
print(int(math.log2(y/x+0.00001) + 1))
# Judge status: Wrong Answer
s = input()
if s[0]=="A" and "C" in s[2:-2] and str(s[0]).isupper()== True and  str(s[1]).islower()==True and str(s[-2:]).islower() == True:
    a=s.index('C')
    if (s[2:a]+s[a+1:-2]).islower()== True:
        print('AC')
else:
    print('WA')
# Judge status: Accepted
n,m=map(int,input().split())
p=1
for i in range(1,int(m**0.5)+1):
  if m%i==0:
    if m//i>=n:
      if i>=n:
        p=max(i,m//i,p)
      else:
        p=max(p,i)
print(p)
# Judge status: Accepted
n,x,y = map(int,input().split())
anslist = [0]*n
for i in range(1,n+1):
    for j in range(i+1,n+1):
        ra = j-i
        rb = abs(x-i) + abs(x-j)
        rc = abs(x-i) + abs(y-j) + 1
        rd = abs(y-i) + abs(y-j)
        anslist[min(ra,rb,rc,rd)] += 1

for i in range(1,n):
    print(anslist[i])
# Judge status: Wrong Answer
n=int(input())
i=0
ans=0
while n>ans:
    i+=1
    ans=2**i
print(ans//2)
# Judge status: Accepted
n, m, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

x = sorted(x)
y = sorted(y)

if(y[0] - x[len(x)-1] >= 1):
    if(x[len(x)-1]-X > 0 and y[0] <= Y):
        print("No War")
    else:
        print("War")
else:
    print("War")
# Judge status: Accepted
import numpy as np
n = int(input())
a = list(map(int, input().split()))
a = np.array(a)
mod = 10**9 + 7
ans = 0
for i in range(60):
  # a要素のi番目のデータが1であるデータの数
  b = np.count_nonzero(a >> i & 1)
  # 2進数 -> 10進数 (b*(N-b)は(1の個数)*(0の個数))
  ans += 2 ** i * (b*(n-b))
  # 和算のたびにmodで割ってあげる
  ans %= mod
print(ans)
# Judge status: Wrong Answer
S=input()

a=int(S[:2])
b=int(S[2:])

if(1<=a<=12 and 1<=b<=12):
  print("AMBIGUOUS")
elif(1<=a<=12):
  print("mmyy")
elif(1<=b<=12):
  print("yymm")
else:
  print("na")
# Judge status: Wrong Answer
import math
N,M = map(int,input().split())

sq = math.sqrt(M)
sq = math.floor(sq)

for i in range(1,sq+2):
  if M % i == 0:
    if i * N <= M:
      ans = i
    
print(int(ans))
# Judge status: Wrong Answer
import math

N = int(input())

def solve(n):
    for i in range(n):
        if math.floor(i * 1.08) == n:
            print(i)
            return
    print(':(')

solve(N)
# Judge status: Accepted
#美しい文字列　044_B

w=input()
count=0
ans='Yes'
t=''
for i in range(len(w)):
    count=0
    t=w[i]
    for e in range(len(w)):
        if t==w[e]:
            count=count+1
    if count%2==1:
        ans='No'
        break
    else:
        ans='Yes'

print(ans)
# Judge status: Accepted
a ,b = map(int,input().split())

if a < b:
    print(str(a) * b)
else:
    print(str(b) * a)
# Judge status: Wrong Answer
n,k=map(int,input().split())

for i in range(n):
  a,b=map(int,input().split())
  k-=b
  if k<=0:
    print(a)
    break
# Judge status: Wrong Answer
arr = [0]*5
for i in range(5):
    arr[i] = int(input())
time = 0
for ar in arr:
    time += (-(-ar//10))*10
amari = []
for i in arr:
    amari.append(i%10)
amari.sort()
for i in range(4):
    if 0 in amari:
        amari.remove(0)
        
print(time - (10-amari[0]))
# Judge status: Wrong Answer
N = int(input())
A = []
for i in range(N):
    A.append(int(input()))
max1 = max(A)
index = []
for i in range(N):
    if(A[i] == max1):
        index.append(i)
A2 = sorted(set(A))
if(len(index) > 1):
    max2 = max1
else:
    max2 = A2[1]
for i in range(N):
    if(i in index):
        print(max2)
    else:
        print(max1)
# Judge status: Accepted
N=int(input())
for i in range(N,999+1):
  check=str(N)
  if check[0]==check[1]==check[2]:
    print(N)
    exit()
  N+=1
# Judge status: Wrong Answer
N, K = map(int,input().split())
A = list(map(int,input().split()))

K = max(K,50)
for k in range(K):
  light = [0] * N
  for i in range(N):
    start = max(0,i-A[i])
    end = min(N-1, i+A[i])
    for j in range(start, end+1):
      light[j] += 1
    
  A = light

print(" ".join(map(str,light)))
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))

tmp = [0 for i in range(N+1)]
length = 0
for i in range(N):
  tmp[i+1] = tmp[i] + A[i]
  length += A[i]
  
ans = 0
for i in range(1, N+1):
 ans = min(ans, abs(length - tmp[i]))

print(ans)
# Judge status: Accepted
s = input()

print(s.replace('2017', '2018'))
# Judge status: Accepted
Q,H,S,D=map(int,input().split())
N=int(input())
Min1=min(4*Q,2*H,S)
Min2=min(2*Min1,D)
Even=N//2
Odd=N%2
ans=Even*Min2+Odd*Min1
print(ans)
# Judge status: Wrong Answer
A, B, C = map(int,input().split())

if C >= A and C <= B:
  print("Yes")
  
else:
  print('NO')
# Judge status: Accepted
def resolve():
    S = set(input())
    print("Yes" if len(S) == 2 else "No")
 
resolve()
# Judge status: Accepted
n, x, t = map(int, input().split())
a = n // x
if n % x == 0:
  print(a * t)
else:
  print((a + 1) * t)
# Judge status: Accepted
a, b, x = map(int, input().split())
A = a // x - (a % x == 0)
B = b // x

print(B - A)
# Judge status: Wrong Answer
n,h,*L=map(int,open(0).read().split());a=max(L[::2]);print(len(b:=[l for l in L[1::2] if l>a])-((sum(b)-h)//a))
# Judge status: Accepted
def main():
    from collections import Counter
    import sys

    input = sys.stdin.readline

    N = int(input())  # <= 10**5
    a = [int(input()) for _ in range(N)]
    ctr = Counter(a)

    ans = 0
    for cnt in ctr.values():
        ans += cnt % 2
    print(ans)


if __name__ == '__main__':
    main()

# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())