Harryxun/stf_run huggingface dataset:
N, M = list(map(int, input().split()))
AC = [0] * N
WA = [0] * N
for i in range(M):
  p, S = input().split()
  p = int(p)
  if(S == "AC"):
    AC[p-1] = 1
  elif(AC[p] == 0):
    WA[p-1] += 1
print(sum(AC), sum(WA))

### FIXED CODE ###

N, M = list(map(int, input().split()))
AC = [0] * N
WA = [0] * N
for i in range(M):
  p, S = input().split()
  p = int(p)
  if(S == "AC"):
    AC[p-1] = 1
  elif(AC[p-1] == 0):
    WA[p-1] += 1
for i in range(N):
  if(AC[i] == 0):
    WA[i] = 0
print(sum(AC), sum(WA))
l = [0] * 10**5
tot = 0
for i in range(N) :
    l[A[i]]+=1
    tot += A[i]
for i in range(Q):
    s0 = S[i][0]
    s1 = S[i][1]
    tot += s1 * (l[s0] + l[s1]) - (s0 * l[s0] + s1*l[s1])
    l[s1] += l[s0]
    l[s0] = 0
    print(tot)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
Q = int(input())
S = [list(map(int, input().split())) for l in range(Q)]

l = [0] * 10**6
tot = 0
for i in range(N) :
    l[A[i]]+=1
    tot += A[i]
for i in range(Q):
    s0 = S[i][0]
    s1 = S[i][1]
    tot += s1 * (l[s0] + l[s1]) - (s0 * l[s0] + s1*l[s1])
    l[s1] += l[s0]
    l[s0] = 0
    print(tot)
w="test"
a=[]
i=0
while(w!=""):
    w=input()
    a.append(w)
a.remove("")
for k in a:
    i+=1
    print("Case {0}: {1}".format(i,k))

### FIXED CODE ###

w=114514
a=[]
i=0
while(w!=0):
    w=int(input())
    a.append(w)
a.remove(0)
for k in a:
    i+=1
    print("Case {0}: {1}".format(i,k))
import sys
sys.setrecursionlimit(10 ** 6)
# input = sys.stdin.readline    ####
int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def printlist(lst, k='\n'): print(k.join(list(map(str, lst))))
INF = float('inf')

def solve():
    n = II()
    A = LI()

    memo = {}
    ans = 0
    for j in range(n):
        sa = j - A[j]
        ans += memo.get(sa, 0)
        wa = j + A[j]
        memo[wa] = memo.get(wa, 0) + 1
        print(memo)
    print(ans)


if __name__ == '__main__':
    solve()


### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)
# input = sys.stdin.readline    ####
int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def printlist(lst, k='\n'): print(k.join(list(map(str, lst))))
INF = float('inf')

def solve():
    n = II()
    A = LI()

    memo = {}
    ans = 0
    for j in range(n):
        sa = j - A[j]
        ans += memo.get(sa, 0)
        wa = j + A[j]
        memo[wa] = memo.get(wa, 0) + 1
        # print(memo)
    print(ans)


if __name__ == '__main__':
    solve()
1 s = int(input())
  2
  3 if s == 1:
  4     print('0')
  5 elif s == 0:
  6     print('1')

### FIXED CODE ###

s = int(input())

if s == 1:
    print(0)
elif s == 0:
    print(1)
N=list(input())
for i,j in range(N):
  N2=N[i],N[j]=N[j],N[i]
  if N2==N.sort():
    print("YES")
    break
else:
  print("NO")
  

### FIXED CODE ###

N=int(input())
l=list(map(int,input().split()))
a=list(range(1,N+1))
count=0
for i in range(0,len(l)):
  if l[i]==a[i]:
    count+=1
if count >= N-2:
  print("YES")
else:
  print("NO")
# C
X = int(input())
import math

def isPrime(n):
    if n % 2 == 0:
        return False
  
    m = math.floor(math.sqrt(n))
    for p in prime_numbers:
        if n % p == 0:
            return False
        if p > m:
        # 素数がnの平方根を超えたら終了
            break
    return True

for i in range(X, 10**9):
    if (is_prime(i)):
        print(i)
        break

### FIXED CODE ###

# C
X = int(input())
import math

import math

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

for i in range(X, 10**9):
    if (is_prime(i)):
        print(i)
        break
b=input()
print("T" if B="A" else "A" if B="T" else "G" if B="C" else "C" if B="G")

### FIXED CODE ###

B=input()
print("T" if B=="A" else "A" if B=="T" else "G" if B=="C" else "C")
# -*- coding: utf-8 -*-

import sys
import os
from collections import deque


N = int(input())
q = deque()

for i in range(N):
    lst = input().split()
    command = lst[0]
    if command == 'insert':
        v = int(lst[1])
        q.appendleft(v)
    elif command == 'delete':
        v = int(lst[1])
        q.remove(v)
    elif command == 'deleteFirst':
        q.popleft()
    elif command == 'deleteLast':
        q.pop()
print(*list(q))

### FIXED CODE ###

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

import sys
import os
from collections import deque


N = int(sys.stdin.readline())
q = deque()

lines = sys.stdin.readlines()
for s in lines:
    lst = s.split()
    command = lst[0]
    if command == 'insert':
        q.appendleft(lst[1])
    elif command == 'delete':
        try:
            q.remove(lst[1])
        except Exception:
            pass
    elif command == 'deleteFirst':
        q.popleft()
    elif command == 'deleteLast':
        q.pop()

print(*q)
s=list(input())

for i in range(len(s)):
  if i%2==1:
    s.pop(i)
  
ss=''.join(map(str,s))

print(ss)

### FIXED CODE ###

s=list(input())

for i in range(len(s)):
  if i%2==1:
    s[i]=''
  
ss=''.join(map(str,s))

print(ss)
import math

nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]


n, a, b, k = map(int, input().split())
count = 0
for i in range(n+1):
    if (k - (i * a)) % b == 0:
        count += (cmb(n, i) * cmb(n, (k-a*i)/b))
print(count%998244353)

### FIXED CODE ###

N,A,B,K = map(int,input().split())
sprime = 998244353 # approx 10**9
A,B = sorted((A,B))
if (A+B) * N < K:
	print(0)
	exit()
 
def egcd(a, b):
    if a == 0:
        return (b, 0, 1)
    else:
        g, y, x = egcd(b % a, a)
        return (g, x - (b // a) * y, y)
 
def modinv(a, m):
    g, x, y = egcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m
 
memo = [0] * (N+1)
memo[0] = memo[N] = 1
for i in range(1,N//2+1):
	v = memo[i-1] * (N-i+1) * modinv(i,sprime)
	v = v % sprime
	memo[i] = memo[N-i] = v
 
# max is A*N + B*N
sum = 0
for b in range(N+1):
  a = (K-b*B)//A
  if 0 <= a <= N and a*A+b*B == K:
    sum += memo[a]*memo[b]
    sum %= sprime
 
print(sum)
A = int(input())
B = int(input())
C = int(input())

if A/B >= C:
  print(C)
else:
  print(A/B)


### FIXED CODE ###

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

if B/A >= C:
  print(C)
else:
  print(B//A)
import numpy as np
(N, M) = map(int, raw_input().split())
cakes = [map(int, raw_input().split()) for i in xrange(N)]
cakes_x = sorted(cakes, key=lambda x: x[0])
cakes_y = sorted(cakes, key=lambda x: x[1])
cakes_z = sorted(cakes, key=lambda x: x[2])

x_min = np.array([0, 0, 0])
x_max = np.array([0, 0, 0])
y_min = np.array([0, 0, 0])
y_max = np.array([0, 0, 0])
z_min = np.array([0, 0, 0])
z_max = np.array([0, 0, 0])
for i in xrange(M):
  x_min += np.array(cakes_x[M])
  x_max += np.array(cakes_x[-M-1])
  y_min += np.array(cakes_y[M])
  y_max += np.array(cakes_y[-M-1])
  z_min += np.array(cakes_z[M])
  z_max += np.array(cakes_z[-M-1])

value = max([sum(map(abs, x_min)), sum(map(abs, x_max)), sum(map(abs, y_min)), sum(map(abs, y_max)), sum(map(abs, z_min)), sum(map(abs, z_max))]
  
print value

### FIXED CODE ###

import numpy as np

(N, M) = map(int, raw_input().split())
cakes = [map(int, raw_input().split()) for i in xrange(N)]
cakes_p = np.array(sorted(cakes, key=lambda x: sum(x))[::-1])
cakes_nx = np.array(sorted(cakes, key=lambda x: sum(x) - 2 * x[0])[::-1])
cakes_ny = np.array(sorted(cakes, key=lambda x: sum(x) - 2 * x[1])[::-1])
cakes_nz = np.array(sorted(cakes, key=lambda x: sum(x) - 2 * x[2])[::-1])
cakes_list = [cakes_p, cakes_nx, cakes_ny, cakes_nz, cakes_p[::-1], cakes_nx[::-1], cakes_ny[::-1], cakes_nz[::-1]]
value = max([sum(map(abs,sum(cake[:M]))) for cake in cakes_list]) if M != 0 else 0

print value
mod=10**9+7
n=int(input())
arr=list(map(int,input().split()))
acum=[1]
for i in range(2,n+1):
  tmp=acum+pow(i,mod-2,mod)
  tmp%=mod
  acum.append(tmp)
ans=0
for i in range(n-1):
  ans+=(arr[i+1]-arr[i])*acum[i]
  ans%=mod
for i in range(1,n):
  ans*=i
  ans%=mod
print(ans)

### FIXED CODE ###

mod=10**9+7
n=int(input())
arr=list(map(int,input().split()))
acum=[0]
for i in range(1,n+1):
  tmp=acum[-1]+pow(i,mod-2,mod)*pow(i+1,mod-2,mod)
  tmp%=mod
  acum.append(tmp)
ans=0
for i in range(n-1):
  ans+=arr[i]*acum[i]
  ans%=mod
  ans-=arr[i]*acum[n-2-i]
  ans%=mod
  ans-=arr[i]*pow(n-1-i,mod-2,mod)
  ans%=mod
for i in range(1,n):
  ans+=arr[-1]*pow(i,mod-2,mod)
  ans%=mod
for i in range(1,n):
  ans*=i
  ans%=mod
print(ans)
n=int(input())
v=list(map(int,input().split()))
a=[]
b=[]
c=dict()
d=dict()

for i in range(0,n,2):
  a.append(v[i])
  if v[i] in c:
    c[v[i]]+=1
  else:
    c[v[i]]=1
    
for j in range(1,n,2):
  b.appene(v[j])
  if v[i] in d:
    d[v[i]]+=1
  else:
    d[v[i]]=1

c_max=c.pop(c.value(max(c.value())))
c_max2=c.pop(c.value(max(c.value())))
d_max=d.pop(d.value(max(d.value())))
d_max2=d.pop(d.value(max(d.value())))
    
if :
  print(n-c_max-d_max)
else:
  if c_max>d_max:
    print(n-c_max-d_max2)
  else:
    print(n-c_max2-d_max)

### FIXED CODE ###

from collections import defaultdict
n = int(input())
A = [int(x) for x in input().split()]
even = A[0::2]
odd = A[1::2]
EC = defaultdict(int)
EC[0] = 0
OC = defaultdict(int)
OC[0] = 0
for e in even:
  EC[e] += 1
for o in odd:
  OC[o] += 1
E = sorted([[v, k] for k, v in EC.items()], reverse=True)
O = sorted([[v, k] for k, v in OC.items()], reverse=True)
if E[0][1] != O[0][1]:
  print(n - E[0][0] - O[0][0])
elif E[1][0] >= O[1][0]:
  print(n - E[1][0] - O[0][0])
else:
  print(n - E[0][0] - O[1][0])

#sample code.
N = input()
A = sorted([int(x) for x in input().split()])
import bisect as bs
ans = 0
f = lambda X, x: bs.bisect_right(X,x) - bs.bisect_left(X.x)
for a in set(A):
    cnt = f(A,a)
    if cnt < a:
        ans += cnt
    else:
        ans += cnt-a
print(ans)

### FIXED CODE ###

N = input()
A = sorted([int(x) for x in input().split()])
import bisect as bs
ans = 0
f = lambda X, x: bs.bisect_right(X,x) - bs.bisect_left(X,x)
for a in set(A):
    cnt = f(A,a)
    if cnt < a:
        ans += cnt
    else:
        ans += cnt-a
print(ans)
n = int(input())
for i in range(n):
    (H,W)=[int(s) for s in input().split()]
    for j in range(H):
        print("#"*W)

### FIXED CODE ###

while(True):
    (H,W)=[int(s) for s in input().split()]
    if (H,W) == (0,0):
        break
    for j in range(H):
        print("#"*W)
    print("")
def function(n,k,a):
    ind1 = a.index(1)
    pre = len(a[:ind1])
    ex = len(a[ind1:])    
    ans = -(-pre//(k-1)) + -(-ex//(k-1))
    if n == k:
        ans = 1
    return int(ans)

print(function(n,k,a))

### FIXED CODE ###

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

ans = -(-(n-1)//(k-1))

print(ans)
a=[[[0]*10]*3]*4
for _ in range(int(input())):
 b,f,r,v=map(int,input().split())
 a[b-1][f-1][r-1]=v
for i in range(4):
 for j in range(3):
  print(' '.join(a[i][j]))
 print(('#'*20))

### FIXED CODE ###

a=[[10*[0]for _ in[0]*3]for _ in[0]*4]
for _ in[0]*int(input()):
 b,f,r,v=map(int,input().split())
 a[b-1][f-1][r-1]+=v
for i in range(4):
 for j in range(3):print('',*a[i][j])
 if i<3:print('#'*20)
a,b=(int(i) for i in input().split())
if a>=9
  print(':(')
elif b>=9:
  print(':(')
else:
  print('Yay!')

### FIXED CODE ###

a,b=(int(x) for x in input().split())
if a>=9:
  print(':(')
elif b>=9:
  #ここ↑のイコールを忘れてた
  print(':(')
else:
  print('Yay!')
from collections import Counter

def main():
    N,P = map(int,input().split())
    S = input()[::-1]
    ans = 0
    if P == 2 or P == 5:
        for i,s in enumerate(S):
            if int(s) % P == 0:
                ans += N-i
    else:
        D = [0] * (N+1)
        for i in range(N):
            D[i] =  int(S[:i+1][::-1]) % P
        C = Counter(D)
        ans = 0
        for i in c.values():
            ans += i*(i-1)//2
    print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    N,P = map(int,input().split())
    S = input()[::-1]
    ans = 0
    if P == 2 or P == 5:
        for i,s in enumerate(S):
            if int(s) % P == 0:
                ans += N - i
    else:
        mods = [0] * P
        mods[0] = 1
        current = 0
        x = 1
        for s in S:
            current = (current + x * int(s)) % P
            ans += mods[current % P]
            mods[current % P] += 1
            x = x * 10 % P
    print(ans)

if __name__ == '__main__':
    main()
n = list(x for x in input())
for i in len(n):
  if n[1] != n[2]:
    print("No")
    break
  else:
    if n[0] == n[1] or n[-1] == n[1]:
      print("Yes")

### FIXED CODE ###

n = input()

if n[1] != n[2]:
  print("No")
else:
  if n[0] == n[1] or n[-1] == n[1]:
    print("Yes")
  else:
    print("No")
a,b=input().split()
A=int(a)
B=float(b)
ans=a*(b*100)/100
print(int(ans))


### FIXED CODE ###

from math import floor
from fractions import Fraction
a, b = input().split()
a = int(a)
b = Fraction(b)
print(floor(a * b))
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
n = int(input())
for i in range(1,n+1):
  b_i = int(input())
for j in range(1,n+1):
  d = [" " if b_j in s else s for s in a]
  e = [" " if b_j in s else s for s in b]
  f = [" " if b_j in s else s for s in c]
if d[0]==d[1]==d[2] or e[0]==e[1]==e[2] or f[0]==f[1]==f[2] or d[0]==e[0]==f[0] or d[1]==e[1]==f[1] or d[2]==e[2]==f[2] or d[0]==e[1]==f[2] or d[2]==e[1]==f[0]:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
b = [int(input()) for _ in range(n)]

for i in range(3):
    for j in range(3):
        for k in range(n):
            if a[i][j] == b[k]:
                a[i][j] = 0

ans = "No"
for i in range(3):
    if a[i][0] + a[i][1] + a[i][2] == 0:
        ans = "Yes"
    if a[0][i] + a[1][i] + a[2][i] == 0:
        ans = "Yes"
if a[0][0] + a[1][1] + a[2][2] == 0:
    ans = "Yes"
if a[0][2] + a[1][1] + a[2][0] == 0:
    ans = "Yes"
print(ans)
from math import sqrt
 
N = int(input())
 
search_max = int(sqrt(N))
 
min_number = 10**12
for x in range(1, search_max + 1):
    if N % x == 0:
        y = N // x
        if x + y < min_number:
            min_number = x + y
  print(min_number-2)

### FIXED CODE ###

N = int(input())
search_max = int(N**0.5)
 
min_number = 10**12
for x in range(1, search_max + 1):
    if N % x == 0:
        y = N // x
        if x + y < min_number:
         
            min_number = x + y
print(min_number-2)
from collections import deque
import numpy as np
n,k = map(int,input().split())
a = list(map(int,input().split()))
roop_find = deque([0])
i = 0
count = 0
while a[i]-1 not in roop_find:
    roop_find.append(a[i]-1)
    i = a[i] - 1
    count += 1
    if count == k:
        print(i + 1)
        break
    else:
        pass
b = roop_find.index(a[i]-1)
roop = list(roop_find)[b:count+1]
if b < k:
    k -= b
    e = k % (count+1-b)
    print(roop[e]+1)


### FIXED CODE ###

n,k = map(int,input().split())
a = list(map(int,input().split()))
pos = 0
visit = [0] * n
move = []
loop = []
while visit[pos] != 2:
    if visit[pos] == 0:
        move.append(pos)
    else:
        loop.append(pos)
    visit[pos] += 1
    pos = a[pos] - 1
if len(move) > k:
    print(move[k]+1)
else:
    print(loop[(k-(len(move)-len(loop)))%len(loop)]+1)
import math
n = input()
a = list(map(int, input().split))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))

### FIXED CODE ###

import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))
from collections import deque
import numpy as np
n,k = map(int,input().split())
a = list(map(int,input().split()))
roop_find = deque([0])
i = 0
count = 0
while a[i]-1 not in roop_find:
    roop_find.append(a[i]-1)
    i = a[i] - 1
    count += 1
    if count == k:
        ans = print(i + 1)
        break
    else:
        pass
b = roop_find.index(a[i]-1)
roop = list(roop_find)[b:count+1]
if b < k:
    k -= b
    e = k % (count+1-b)
    print(roop[e]+1)


### FIXED CODE ###

n,k = map(int,input().split())
a = list(map(int,input().split()))
pos = 0
visit = [0] * n
move = []
loop = []
while visit[pos] != 2:
    if visit[pos] == 0:
        move.append(pos)
    else:
        loop.append(pos)
    visit[pos] += 1
    pos = a[pos] - 1
if len(move) > k:
    print(move[k]+1)
else:
    print(loop[(k-(len(move)-len(loop)))%len(loop)]+1)
N=input()
print(N*(N-1)/2)

### FIXED CODE ###

N=int(input())
print(N*(N-1)//2)
from collections import defaultdict

n = int(input())
a = [int(x) for x in input().split()]

cnt = defaultdict(int)
for v in a:
  cnt[v] += 1

ans = 0
for k, v in cnt:
  ans += v*(v-1)//2

for v in a:
  print(ans + (cnt[v]-1)*(cnt[v]-2)//2 - cnt[v]*(cnt[v]-1)//2)

### FIXED CODE ###

from collections import defaultdict

n = int(input())
a = [int(x) for x in input().split()]

cnt = defaultdict(int)
for v in a:
  cnt[v] += 1

ans = 0
for v in cnt:
  ans += cnt[v]*(cnt[v]-1)//2

for v in a:
  print(ans + (cnt[v]-1)*(cnt[v]-2)//2 - cnt[v]*(cnt[v]-1)//2)
import math
s=int(imput())
m=100000
for i in range(1:s):
    m=m.ceil((m*1.05)/1000)*1000

print(m)
    

### FIXED CODE ###

import math
s=int(input())
m=100000
for i in range(s):
    m=math.ceil((m*1.05)/1000)*1000

print(m)
n,m = map(int,input().split())
l = [int(input()) for _ in range(m)]
q = 10**9+7
memo = [0]*(n+1)
memo[0]=1
def a(x):
  if x in l :
    return 0
  elif x==1:
    memo[1]=1
    return 1
  else:
    if memo[x]!=0:
      return memo[x]
    else:
      memo[x] = a(x-1)+a(x-2)
      return (a(x-1)+a(x-2))%
print(a(n)%q)

### FIXED CODE ###

n,m = map(int,input().split())
l = [int(input()) for _ in range(m)]
q = 10**9+7
memo = [-1]*(n+1)
memo[0]=1
su = 0
if 1 in l:
  memo[1]=0
else:
  memo[1]=1
for j in l:
  memo[j]=0
  
for i in range(2,n+1):
  if memo[i]==0:
    continue
  else:
    memo[i]=((memo[i-1]%q)+(memo[i-2]%q))%q
print(memo[-1]%q)
a,b,c=input().split()

if a[len(a-1)] == b[0] and b[len(b-1)] == c[0]:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

a,b,c=input().split()

if a[len(a)-1] == b[0] and b[len(b)-1] == c[0]:
  print("YES")
else:
  print("NO")
k = int(input())
s = 7
if k%2 == 0:
	print(-1)
elif k%5 == 0:
	print(-1)
else:
	while s%k != 0:
		s = 10*s+7
	print(len(s))

### FIXED CODE ###

import sys

k = int(input())

a = 0

for i in range(1, k+1):
	a = (a*10+7)%k
	if a == 0:
		print(i)
		sys.exit()
print(-1)
k = int(input())
ok = [0]*k
x=7 % k
ok[x] = 1
if x == 0:
  print(1)
else:
  now = 1
  while now+=1:
    x = x*10 +7
    if ok[x] == 1:
      print(-1)
      break
    elif x == 0:
      print(now)
      break

### FIXED CODE ###

k = int(input())
ok = [0]*k
x=7 % k
ok[x] = 1
if x == 0:
  print(1)
else:
  now = 1
  while 1:
    now += 1
    x = (x*10 +7) % k
    if ok[x] == 1:
      print(-1)
      break
    elif x == 0:
      print(now)
      break
    else:
      ok[x] = 1
n = int(input())
a = [0]*n
for i in range(n):
    a[i] = int(input())

t = max(a)
b = [0]*(t+1)

for i in range(n):
    if(b[a[i]] == 0):
        b[a[i]] = 1
    else:
        b[a[i]] = 0

print(sum(b))

### FIXED CODE ###

n = int(input())
a = [int(input()) for _ in range(n)]
a.sort()
d = [1]
for i in range(n-1):
    if a[i] != a[i+1]:
        d.append(1)
    else:
        d[-1] += 1
ans = 0
for i in d:
    ans += i%2
print(ans)
import sys
print(sys.stdin.read().split().count(input()))

### FIXED CODE ###

import sys
w=input().upper()
print(sys.stdin.read().upper().split().count(w))
from sys import exit, stderr, stdin, setrecursionlimit
input = stdin.readline
# setrecursionlimit(10**7)

def debug(var, name="hoge"):
    print(name +":" + str(type(var)) + " = " + repr(var), file=stderr)
    return



def main():
    # まず可能かどうか
    S = str(input().rstrip())*2
    T = str(input().rstrip())
    LS = len(S)//2
    LT = len(T)
    S *= 3
    # はじめて出る位置
    char_p = dict()
    for i in range(LS):
        if not S[i] in char_p:
            char_p[S[i]] = i
    print(char_p)

    # char_pの文字が２つめのはじめて出る位置までに
    char_d = dict(zip(char_p.keys(),[[0 for __ in range(LS+char_p[c])] for c in char_p]))
    for c in char_p:
        dis = 1
        for i in range(LS+char_p[c]-1,-1,-1):
            if S[i] == c:
                char_d[c][i] = dis
                dis = 1
            else:
                char_d[c][i] = dis
                dis += 1
    # 答えの計算
    debug(char_d)
    cur = char_p[T[0]]
    for t in T[1:]:
        if t not in char_p:
            print(-1)
            exit()
        else:
            debug(t,'string')
            #それ以外なら区切りで相対的な位置を出して足す
            rel_cur = cur%LS
            debug(rel_cur,"relative_cursol")
            cur += char_d[t][rel_cur]
        debug(cur,"cur")
        # print()
    print(cur+1)






if __name__ == "__main__":
    main()


### FIXED CODE ###

from sys import exit, stderr, stdin, setrecursionlimit
input = stdin.readline
# setrecursionlimit(10**7)

def debug(var, name="hoge"):
    print(name +":" + str(type(var)) + " = " + repr(var), file=stderr)
    return



def main():
    # まず可能かどうか
    S = str(input().rstrip())*2
    T = str(input().rstrip())
    LS = len(S)//2
    LT = len(T)
    S *= 3
    # はじめて出る位置
    char_p = dict()
    for i in range(LS):
        if not S[i] in char_p:
            char_p[S[i]] = i

    # char_pの文字が２つめのはじめて出る位置までに
    char_d = dict(zip(char_p.keys(),[[0 for __ in range(LS+char_p[c])] for c in char_p]))
    for c in char_p:
        dis = 1
        for i in range(LS+char_p[c]-1,-1,-1):
            if S[i] == c:
                char_d[c][i] = dis
                dis = 1
            else:
                char_d[c][i] = dis
                dis += 1
    # 答えの計算
    debug(char_d)
    init = True
    for t in T:
        if t not in char_p:
            print(-1)
            exit()
        else:
            debug(t,'string')
            if init:
                cur = char_p[t]
                init = False
            #それ以外なら区切りで相対的な位置を出して足す
            else:
                rel_cur = cur%LS
                debug(rel_cur,"relative_cursol")
                cur += char_d[t][rel_cur]
        debug(cur,"cur")
        # print()
    print(cur+1)






if __name__ == "__main__":
    main()
S = input()
T = input()

if (T[:len(S)] == S) and (len(T) = len(S) + 1):
    print('Yes')
else:
    print('No')

### FIXED CODE ###

S = input()
T = input()

if (T[:len(S)] == S) and (len(T) == len(S) + 1):
    print('Yes')
else:
    print('No')
# coding: utf-8

num_of_coins, border = (int(n) for n in input().split)
if 500 * num_of_coins >= border:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

# coding: utf-8

num_of_coins, border = (int(n) for n in input().split())
if 500 * num_of_coins >= border:
  print("Yes")
else:
  print("No")
f=input().split(" ")
x=f[1]
y=f[2]
z=x+y/2
print(z)


### FIXED CODE ###

number=input().split(" ")
x=int(number[0])
y=int(number[1])
z=x+y/2
print(int(z))
n,k=map(int,input()split())

while True:
  x=n
  n=abs(n-k)
  if x==n:
    break
  
  print (n)
  


### FIXED CODE ###

n,k=map(int,input().split())
a=n%k
b=k-a
print(min(a,b))
N,D = list(map(int,input().split()))
human = 1
hani = 2*D+1
haniwhile hani < N:
    hani = hani + (2*D+1)
    human +=1
    
print(human) = kanshi


### FIXED CODE ###

r = int(input())

print(3*r*r)
n = input()
sum = 0
for i in rangr(n):
  a = map(int, raw_input().split())
  a.sort()
for i in range(n):
  sum += a[i]
print '%d %d %d' % (a[0], a[n-1], sum)

### FIXED CODE ###

n = input()
sum = 0
a = map(int, raw_input().split())
a.sort()
for i in range(n):
  sum += a[i]
print '%d %d %d' % (a[0], a[n-1], sum)
A = int(input())
B = int(input())
print(max(A+B,A-B,A*B))


### FIXED CODE ###

A,B = map(int, input().split())
print(max(A+B,A-B,A*B))