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

s = input()
n = len(s)
mods = [0] * 2019
mods[0] = 1

for i in range(n-1, -1, -1):
    mod = int(s[i:]) % 2019
    mods[mod] += 1

ans = 0
for i in range(2019):
    ans += mods[i] * (mods[i] - 1) // 2
print(ans)


### FIXED CODE ###

s = input()
n = len(s)
MOD = 2019
mods = [0] * MOD
mods[0] = 1

prev = 0
for i in range(n-1, -1, -1):
    mod = int(s[i]) * pow(10, n-i, MOD) % MOD
    mod = (mod + prev) % MOD
    mods[mod] += 1
    prev = mod

ans = 0
for i in range(MOD):
    ans += mods[i] * (mods[i] - 1) // 2
print(ans)
### BUGGY CODE ###

def chn(c):
	tot=1
	for i in range(len(c)):
		tot=tot*c[i]
		
	if tot>pow(10,18) and 0 in c:
		return 0
	elif tot>pow(10,18) and 0 not in c:
		return -1
		
	return tot


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

print(chn(c))


### FIXED CODE ###

n=int(input())
c=sorted(list(map(int,input().split())))[::-1]
if c[-1]==0:
	print(0)
else:
	tot=1
	flag=0
	for i in range(len(c)):
		tot*=c[i]
		if tot>1000000000000000000:
			print(-1)
			flag=1
			break
	if flag==0:
		print(tot)
### BUGGY CODE ###

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

ball = []
ans = 0
for k in range(N//(A+B)) :
    for i in range(A) :
        ball.append('b')
    for j in range(B) :
        ball.append('r')

mod = N % (A+B)
for l in range(N % (A+B)) :
    for m in range(A) :
        if mod > 0 :
            ball.append('b')
            mod -= 1
        else :
            break
    for n in range(B):
        if mod > 0 :
            ball.append('r')
            mod -= 1
        else :
            break

#print(ball)
ans = ball.count('b')
print(ans)

### FIXED CODE ###

N, A, B= map(int, input().split())
ans = 0

div = N//(A+B) * A
mod = N % (A+B)
ans = div + min(mod, A)

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

from math import sqrt, ceil

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

count = 1
primes = [2]

for i in range(3, ceil(sqrt(min(A, B))), 2):
    for j in primes:
        if i % j == 0:
            break
    else:
        primes.append(i)

for i in primes:
    if A % i == B % i == 0:
        count += 1
if count == 1 and min(A, B) != 1 and max(A, B) % min(A, B) == 0:
    count += 1

print(count)


### FIXED CODE ###

from fractions import gcd
from math import sqrt, ceil

A, B = map(int, input().split())
gcd_ = gcd(A, B)

count = 1
for i in range(2, ceil(sqrt(gcd_)) + 1):
    if gcd_ % i == 0:
        count += 1
        while gcd_ % i == 0:
            gcd_ /= i

if gcd_ != 1:
    count += 1

print(count)
### BUGGY CODE ###

#d
A,B,N=map(int,input().split())
a=0
for i in range(1,N+1):
    p=(A*i)//B-A*(i//B)
    if p>a:
        a=p
print(a)

### FIXED CODE ###

#d
A,B,N=map(int,input().split())
b=[]
if N>=B:
    b.append((N//B)*B-1)
b.append(N)
a=0
for x in b:
    p=(A*x)//B-A*(x//B)
    if p>a:
        a=p
print(a)
### BUGGY CODE ###

N = int(input())

import numpy as np

for i in range(1,N+1):

    right = 2 * i


    er = int(np.ceil(np.sqrt(right)))

    count = 0

    for x in range(1,er):
        
        if right - x**2 < 1:
            continue
        
        for y in range(1, int(np.ceil(np.sqrt(right - x**2))) + 1):
          
            if right - x**2 - y**2 < 1:
                continue
          
            for z in range(1,int(np.ceil(np.sqrt(right - x**2 - y**2))) + 1):
                if (x + y + z) % 2 != 0:
                    continue
                  
                elif (x ** 2 + y ** 2 + z ** 2 == 2 * i) & (x + y > z) & (y + z > x) & (z + x > y):
                    count += 1
            
    print(count)        

### FIXED CODE ###

n = int(input())
ans = [0 for a in range(10050)]


for i in range(1,105):
  for j in range(1,105):
    for k in range(1,105):
      v = i*i+j*j+k*k+i*j+j*k+k*i;
      
      if v<10050:
        ans[v]+=1

for i in range(n):
  print(ans[i+1])
### BUGGY CODE ###

import itertools

N = int(input())
S = input()
S_list = []
for i in range(len(S)):
    S_list.append(S[i])

comb_S_list = set(itertools.combinations(S_list,3))

print(len(comb_S_list))


### FIXED CODE ###

N = int(input())
S = input()
cnt = 0

for i in range(10):
    a = S.find(str(i))
    if a == -1 : continue
    for j in range(10):
        b = S.find(str(j),a+1)
        if b == -1 : continue
        for k in range(10):
            c = S.find(str(k),b+1)
            if c != -1 :
                cnt += 1

print(cnt)
### BUGGY CODE ###

import collections

def check_equal(a_dict, b_dict):
    result = True
    for k_a, v_a in a_dict.items():
        if k_a not in b_dict:
            result = False
            break
        if a_dict[k_a] != b_dict[k_a]:
            result = False
            break
    
    return result


if __name__ == "__main__":    
    N = int(input())
    count_list = []

    for i in range(N):
        sentence = input()
        c = dict(collections.Counter(sentence))
        count_list.append(c)

    total = 0
    for i in range(N):
        for j in range(i+1, N):
            total += check_equal(count_list[i], count_list[j])

    print(total)

### FIXED CODE ###

N = int(input())

sentence_count_dict = {}
for _ in range(N):
    sentence = list(input())
    sentence = ''.join(sorted(sentence))
    if sentence in sentence_count_dict:
        sentence_count_dict[sentence] += 1
    else:
        sentence_count_dict[sentence] = 1

total = 0
for v in sentence_count_dict.values():
    total += (v * (v-1)) / 2

print(int(total))
### BUGGY CODE ###

K,S = map(int, input().split())

count=0

for x in range(K+1):
    for y in range(K+1):
            for z in range(K+1):
                    if x + y + z == S:
                            count+=1
        
print(count)

### FIXED CODE ###

K,S = map(int, input().split())

count=0

for x in range(K+1):
    for y in range(K+1):
            z = S-x-y
            if 0<= z <=K:
                count+=1
        
print(count)
### BUGGY CODE ###

import numpy as np

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

res = np.zeros(N) + K
for a in As:
    res -= 1
    res[a-1] += 1

for i in range(N):
    if res[i] > 0 :
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

import numpy as np

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

res = np.zeros(N)
for a in As:
    res[a-1] += 1
    
for i in range(N):
    if res[i] > (Q - K) :
        print('Yes')
    else:
        print('No')
### BUGGY CODE ###

n = int(input())
x_bin = input()
x = int(x_bin, 2)

def solve(a, pc):
    if pc == 0:
        return 0
    elif pc == 1:
        return 1
    return solve(a % pc, bin(a % pc).count('1')) + 1
        
pc = bin(x).count('1')
pc_p = pc + 1
pc_m = pc - 1

for i in reversed(range(n)):
    if x_bin[n-i-1] == '1':
        a = x - pow(2, i)
        print(solve(a, pc_m))
    else:
        a = x + pow(2, i)
        print(solve(a, pc_p))


### FIXED CODE ###

n = int(input())
x_bin = input()
x = int(x_bin, 2)

pc = x_bin.count('1')
pc_p = pc + 1
pc_m = pc - 1

if pc == 1:
    for i, v in enumerate(x_bin):
        if v == '1':
            print(0)
        else:
            if i != n-1:
                if x_bin[-1] == '0':
                    print(1)
                else:
                    print(2)
            else:
                print(2)
    exit()

p = {0: 1}
m = {0: 1}
for i in range(1, n):
    p[i] = p[i-1]*2 % pc_p
    m[i] = m[i-1]*2 % pc_m

rest = {0: 0}
for i in range(1, pc + 1):
    rest[i] = rest[i % bin(i).count('1')] + 1

x_p = x % pc_p
x_m = x % pc_m

for i in range(n, 0, -1):
    if x_bin[n-i] == '1':
        a = (x_m - m[i-1]) % pc_m
        print(rest[a] + 1)
    else:
        a = (x_p + p[i-1]) % pc_p
        print(rest[a] + 1)
### BUGGY CODE ###

# -*- coding:utf-8 -*-
n = int(input())
S = list(map(int,input().split()))
q = int(input())
T = list(map(int,input().split()))

sum = 0
for c in T:
    left = 0
    right = n
    mid = 0
    while left < right:
        mid = int(( left + right ) / 2)
        if c == S[mid]:
            sum += 1
            break
print(sum)

### FIXED CODE ###

n = int(input())
S = list(map(int,input().split()))
q = int(input())
T = list(map(int,input().split()))

sum = 0
for c in T:
    left = 0
    right = n
    mid = 0
    if c == S[left] or c == S[right-1]:
        sum += 1
    else:
        while left+1 < right:
            mid = int(( left + right ) / 2)
            if c == S[mid]:
                sum += 1
                break
            if c > S[mid]:
                left = mid
                mid = 0
            elif c < S[mid]:
                right = mid
                mid = 0
print(sum)
### BUGGY CODE ###

from operator import add


class SegTree():
    def __init__(self, N, e=float("inf"), operator_func=min):
        self.e = e
        self.size = N
        self.node = [self.e] * (2*N)
        self.op = operator_func

    def set_list(self, l):
        for i in range(self.size):
            self.node[i+self.size-1] = l[i]
        for i in range(self.size-1)[::-1]:
            self.node[i] = self.op(self.node[2*i+1], self.node[2*i+2])
    
    def update(self, k, x):
        k += self.size - 1
        self.node[k] = x
        while k >= 0:
            k = (k - 1) // 2
            self.node[k] = self.op(self.node[2*k+1], self.node[2*k+2])

    def get(self, l, r):
        x = self.e
        l += self.size; r += self.size
        a, b = [], []

        while l<r:
            if l&1:
                a += [l-1]; l += 1
            if r&1:
                r -= 1; b += [r-1]
            l >>= 1; r >>= 1

        for i in a+(b[::-1]):
            x = self.op(x, self.node[i])
        return x


def solve():
    N, Q = map(int, input().split())
    *c, = map(int, input().split())
    tree = SegTree(N+1, 0, add)
    m = [tuple(map(int, input().split()))+(i,) for i in range(Q)]
    m.sort(key=lambda x:x[1])

    right = 0
    pos = [None] * (N+1)
    ans = [None] * (Q)

    for l, r, k in m:
        if right != r:
            for i in range(right, r):
                if pos[c[i]]:
                    tree.update(pos[c[i]], 0)
                pos[c[i]] = i+1
                tree.update(i+1, 1)
        ans[k] = tree.get(l, r+1)
        right = r
    print(*ans, sep="\n")


solve()


### FIXED CODE ###

class FenwickTree:
    def __init__(self, size):
        self.size = size
        self.array = [0]*size
 
    def add(self, index, value):
        while index < self.size:
            self.array[index] += value
            index += index&(-index)
 
    def sum(self, index):
        answer = 0
        while index > 0:
            answer += self.array[index]
            index -= index&(-index)
        return answer
 
    def rangesum(self, start, end):
        return self.sum(end)-self.sum(start-1)


def solve():
    N, Q = map(int, input().split())
    *c, = map(int, input().split())
    tree2 = FenwickTree(N+1)
    m = [list(map(int, input().split())) for _ in range(Q)]
    idxs = sorted(list(range(Q)), key=lambda i: m[i][1])

    right = 0
    pos = [-1] * (N+1)
    ans = [-1] * (Q)

    for idx in idxs:
        l, r = m[idx]
        for i in range(right, r):
            x = pos[c[i]]
            if x != -1:
                tree2.add(x, -1)
            pos[c[i]] = i+1
            tree2.add(i+1, 1)
        ans[idx] = tree2.rangesum(l, r)
        right = r
    print(*ans, sep="\n")


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

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

ans = 0
for t in set(a):
  cnt = a.count(t)
  if t > cnt:
    ans += cnt
  else:
    ans += (cnt -t)

print(ans)

### FIXED CODE ###

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

from collections import defaultdict
d = defaultdict(int)

for i in a:
  d[i] += 1

ans = 0
for t in set(a):
  cnt = d[t]

  if t > cnt:
    ans += cnt
  else:
    ans += (cnt - t)

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

import sys

input = sys.stdin.readline

n=int(input())
s=list(input())

rn=s.count('R')
gn=s.count('G')
bn=n-rn-gn

ans=bn*gn*rn
if n>2:
  
  for x in range(n-2):
    
    y=(n-1-x)//2
    for i in range(1,y+1):
      if  (not s[x]==s[x+i]) & (not s[x]==s[x+i+i]) & (not s[x+i]==s[x+i+i]):
        ans-=1
        
  print(ans)
    
else:
  print(0)


### FIXED CODE ###

n=int(input())
s=list(input())

rn=s.count('R')
gn=s.count('G')
bn=n-rn-gn

ans=bn*gn*rn
if n>2:
  
  for x in range(n-2):
    
    y=(n-1-x)//2
    for i in range(1,y+1):
      if  (not s[x]==s[x+i]) & (not s[x]==s[x+i+i]) & (not s[x+i]==s[x+i+i]):
        ans-=1
        
  print(ans)
    
else:
  print(0)
### BUGGY CODE ###

n=int(input())
ar=list(map(int,input().split()))
di={}
for i in range(n):
    if ar[i] not in di:
        di[ar[i]]=1
    else:
        di[ar[i]]+=1
q=int(input())
for i in range(q):
    b,c=map(int,input().split())
    if(b in di):
        x=di[b]
        del di[b]
        if(c in di):
            di[c]+=x
        else:
            di[c]=x
    s=0
    for j in di.keys():
        s+=j*(di[j])
    print(s)

        
        
    

### FIXED CODE ###

n=int(input())
ar=list(map(int,input().split()))
di={}
for i in ar:
    di[i]=di.get(i,0)+1
sm=sum(ar)
q=int(input())
for i in range(q):
    b,c=map(int,input().split())
    if(b not in di):
        print(sm)
    elif(b in di):
        x=di[b]
        del di[b]
        if(c in di):
            di[c]+=x
        else:
            di[c]=x
        s=0
        s=sm-(b*x)+(x*c)
        sm=s
        print(s)
### BUGGY CODE ###

n= int(input())
s_list= list(input())
count=0
rr,bb,gg=0,0,0
for i in range(0,n):
    if s_list[i]=="R":
        rr=rr+1
    elif s_list[i]=="G":
        gg=gg+1
    else:
        bb=bb+1
sum=rr*gg*bb

for p in range(0,n-2):
    for q in range(p+1,n-1):
        if s_list[p] == s_list[q]:
            continue
        else:
            for r in range(q+1,n):
                if s_list[r]==s_list[p] or s_list[r]==s_list[q] :
                    continue
                elif r-q==q-p:
                    count = count+1
print(sum-count)

### FIXED CODE ###

n= int(input())
s_list= list(input())
count=0
rr,bb,gg=0,0,0
for i in range(0,n):
    if s_list[i]=="R":
        rr=rr+1
    elif s_list[i]=="G":
        gg=gg+1
    else:
        bb=bb+1
sum=rr*gg*bb

for p in range(0,n-2):
    for q in range(p+1,n-1):
        if s_list[p] == s_list[q]:
            continue
        elif 2*q-p<n and s_list[2*q-p]!=s_list[p] and s_list[2*q-p]!=s_list[q]:
            count= count+1
print(sum-count)
### BUGGY CODE ###

import copy
N = int(input())

lst = []
for i in range(N):
    lst.append(int(input()))

for i in range(N):
    lstAns = copy.copy(lst)
    a = lstAns.pop(i)
    print(max(lstAns))


### FIXED CODE ###

N = int(input())

lst = []
for i in range(N):
    lst.append(int(input()))

lstA = sorted(lst,reverse=True)

for i in range(N):
    if lst[i] == lstA[0]:
        print(lstA[1])
    else:
        print(lstA[0])
### BUGGY CODE ###

n, m = map(int,input().split())
price = list(map(int, input().split()))
price.sort(reverse=True)

while m != 0:
    price[0] //= 2
    price.sort(reverse=True)
    m -= 1
print(sum(price))


### FIXED CODE ###

import heapq

n, m = map(int,input().split())
price = list(map(int, input().split()))
price = list(map(lambda x: x*(-1), price))
heapq.heapify(price)
while m != 0:
    maxv = heapq.heappop(price)
    heapq.heappush(price, (maxv+1) // 2)
    m -= 1
print(sum(price) * (-1))
### BUGGY CODE ###

import numpy as np 

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

##A = np.array(A,np.int64)##Ai<2^60

ans = 0
mod = int(1e9+7)

for i in range(60+1):
    bottom_bit = (A>>i)&1 ##i回シフトしたときの最下位bit
    ones = sum(bottom_bit[bottom_bit==1])
    ##ans += (N-ones)*ones*(2**i) ##0の個数*1の個数*2^i個
    tmp = ones*(N-ones)
    for j in range(i):
        tmp = (tmp * 2) % mod
    ans += tmp

print(ans%mod)

### FIXED CODE ###

import numpy as np 

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

A = np.array(A,np.int64)##Ai<2^60

ans = 0
mod = int(1e9+7)

for i in range(60+1):
    bottom_bit = (A>>i)&1 ##i回シフトしたときの最下位bit
    ones = np.sum(bottom_bit[bottom_bit>0])
    ##ans += (N-ones)*ones*(2**i) ##0の個数*1の個数*2^i個
    tmp = ones*(N-ones)
    for j in range(i):
        tmp = (tmp * 2) % mod
    ans += tmp

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

N, M=map(int, input().split())


ACs=[]
WAs={}

AC=0
pena=0
for i in range(M):
  num, jud=input().split()
  if num in ACs:
    continue
  
  if jud=="WA":
    if num not in WAs.keys():
      WAs[num]=1
    else:
      WAs[num]+=1
  else:
    ACs.append(num)
    AC+=1
    if num in WAs.keys():
      pena+=WAs[num]

print(AC, pena)



### FIXED CODE ###

N, M=map(int, input().split())
import numpy as np

pena=np.array([0]*N)
status=np.array([0]*N)


for i in range(M):
  p,s=tuple(input().split())
  p=int(p)
  if s=="WA":
    if status[p-1]!=1:
      pena[p-1]+=1
  if s=="AC":
    if status[p-1]!=1:
      status[p-1]=1
nac=sum(status)
npena=sum(pena*status)
print(nac, npena)
### BUGGY CODE ###

import sys
 
lines = sys.stdin.readlines()
num_a ,num_b, num_m = [int(v) for v in lines[0].split()]
# ----
 
a_list = [int(v) for v in lines[1].split()[:num_a+1]]
b_list = [int(v) for v in lines[2].split()[:num_b+1]]
 
# print(a_list)
# print(b_list)
 
result = max(a_list) + max(b_list)
ignores = set()
for c in lines[3:num_m+3]:
    a_i, b_i, discount = map(int, c.split())
    try:
        ignores.add((int(a_i), int(b_i)))
        
        price = a_list[a_i-1] + b_list[b_i-1] - discount
        
        if price < result:
            result = price
    except IndexError:
        print('------')
        print(c)
        pass
 
# ---
# result = max(a_list) + max(b_list)
for i, a in enumerate(a_list):
    for j, b in enumerate(b_list):
        if (i+1, j+1) not in ignores:
            price = a + b
            result = price if price < result else result
            
print(result)

### FIXED CODE ###

import sys

lines = sys.stdin.readlines()

# lines = test.strip().split('\n')
num_a ,num_b, num_m = [int(v) for v in lines[0].split()]
# ----

a_list = [int(v) for v in lines[1].split()[:num_a+1]]
b_list = [int(v) for v in lines[2].split()[:num_b+1]]

res1 = [
    a_list[a_i-1]+b_list[b_i-1]-discount for a_i, b_i, discount in [
        map(int, l.split())  for l in lines[3:num_m+3]
    ]
]

res2 = min(a_list) + min (b_list)

print(min(min(res1), res2))
### BUGGY CODE ###

# AtCoder DP Task D - Knapsack 1
def knapsack(target, W, V): # target=knapsack weight
    P = [[0] * (target + 1) for _ in range(len(V))]
    for vi in range(len(V)):
        row, prev = P[vi], P[vi - 1]
        for w in range(target + 1):
            if vi > 0:
                row[w] = prev[w] # same value without vi-th item
                if w >= W[vi]:
                    new = P[vi - 1][w - W[vi]] + V[vi]
                    if new > P[vi][w]: # most value
                        row[w] = new
            else:
                if w >= W[vi]:
                    row[w] = V[vi]
    return P[len(V) - 1][target]

def knapsack_rec(target, W, V): # target=knapsack weight
    P = [[-1] * (target + 1) for _ in range(len(V))]

    def rec(w, index):
        if index == 0 and w >= W[index]:
            return V[index]
        elif index > 0:
            if P[index][w] != -1:
                return P[index][w]
            r = rec(w, index - 1)
            if w >= W[index]:
                y = rec(w - W[index], index - 1) + V[index]
                r = r if r > y else y
            P[index][w] = r
            return r
        return 0

    ret = rec(target, len(V) - 1)
    return ret

assert knapsack_rec(15, [6, 5, 6, 6, 3, 7], [5, 6, 4, 6, 5, 2]) == 17

if __name__ == "__main__":
    import sys
    n, w, *r = map(int, sys.stdin.read().split())
    W, V = r[::2], r[1::2]
    ans = knapsack_rec(w, W, V)
    print(ans)


### FIXED CODE ###

# AtCoder DP Task D - Knapsack 1
def knapsack(target, W, V): # target=knapsack weight
    P = [[0] * (target + 1) for _ in range(len(V))]
    for vi in range(len(V)):
        row, prev = P[vi], P[vi - 1]
        for w in range(target + 1):
            if vi > 0:
                row[w] = prev[w] # same value without vi-th item
                if w >= W[vi]:
                    new = P[vi - 1][w - W[vi]] + V[vi]
                    if new > P[vi][w]: # most value
                        row[w] = new
            else:
                if w >= W[vi]:
                    row[w] = V[vi]
    return P[len(V) - 1][target]

def knapsack_rec(target, W, V): # target=knapsack weight
    P = [-1] * (target + 1)
    P[target] = 0 # default + max

    for vi in range(len(V)):
        we = W[vi]
        va = V[vi]
        for i in range(we, target + 1):
            if P[i] != -1 and P[i - we] < P[i] + va:
                P[i - we] = P[i] + va

    return max(P)

assert knapsack_rec(15, [6, 5, 6, 6, 3, 7], [5, 6, 4, 6, 5, 2]) == 17

if __name__ == "__main__":
    import sys
    n, w, *r = map(int, sys.stdin.read().split())
    W, V = r[::2], r[1::2]
    ans = knapsack_rec(w, W, V)
    print(ans)
### BUGGY CODE ###

import sys
input = sys.stdin.readline

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

A.sort()
F.sort(reverse=True)


MIN=0
MAX=max(A)*max(F)

while MIN!=MAX:
    mid=(MIN+MAX)//2
    score=0

    for i in range(N):
        if A[i]*F[i]>mid:
            score+=A[i]-mid//F[i]

    if score<=K:
        MAX=mid
    else:
        MIN=mid+1

print(MIN)


### FIXED CODE ###

import sys
input = sys.stdin.readline

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

A.sort()
F.sort(reverse=True)


MIN=0
MAX=max(A)*max(F)

while MIN!=MAX:
    mid=(MIN+MAX)//2
    score=0

    for i in range(N):
        if A[i]*F[i]>mid:
            score+=A[i]-mid//F[i]

    if score<=K:
        MAX=mid
    else:
        MIN=mid+1

print(MIN)
### BUGGY CODE ###

n = int(input())
ans = 0
a = [input() for i in range(n)]
t = list(set(a))
for i in t:
    if a.count(i) % 2 == 1:
        ans += 1
print(ans)

### FIXED CODE ###

from collections import Counter
n = int(input())
a = Counter([input() for i in range(n)])
print(len([x for x in a.values() if x % 2 == 1]))
### BUGGY CODE ###

n = int(input())
S = [input() for i in range(n)]

ans = 0
start_b = 0
end_a = 0
ab = 0

for i in range(n):
    for j in range(len(S) - 1):
        if S[i][j:j+2] == 'AB':
            ans += 1

    if S[i][0] == 'B' and S[i][-1] == 'A':
        ab += 1
        continue 
    if S[i][0] == 'B':
        start_b += 1
    if S[i][-1] == 'A':
        end_a += 1
    
ans += min(start_b, end_a)
if ab > 0:
    ans += ab - 1
    ans += min(1, abs(start_b - end_a))

print(ans)

### FIXED CODE ###

n = int(input())
S = [input() for i in range(n)]

ans = 0
start_b = 0
end_a = 0
ab = 0

for i in range(n):
    for j in range(len(S) - 1):
        if S[i][j:j+2] == 'AB':
            ans += 1

    if S[i][0] == 'B' and S[i][-1] == 'A':
        ab += 1
        continue 
    if S[i][0] == 'B':
        start_b += 1
    if S[i][-1] == 'A':
        end_a += 1
    

if ab > 0:
    ans += ab - 1
    if start_b > 0:
        ans += 1
        start_b -= 1
    if end_a > 0:
        ans += 1
        end_a -= 1
        
ans += min(start_b, end_a)

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

import fractions
import copy
from functools import reduce

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

ans=1
if N==1:
    ans=10**9
elif N==2:
    ans=max(A)
else:
    for a in A:
        A2=copy.deepcopy(A)
        A2.remove(a)
        ans=max(ans,reduce(fractions.gcd, A2))
print(ans)

### FIXED CODE ###

import sys

sys.setrecursionlimit(1000000)

import fractions
from functools import reduce

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

def mygcd(a,b):
    if a==0:
        return b
    elif b==0:
        return a
    else:
        return fractions.gcd(a,b)

L=[0]*N
for i in range(1,N):
    L[i]=mygcd(L[i-1],A[i-1])

R=[0]*N
for i in range(N-2,-1,-1):
    R[i]=mygcd(R[i+1],A[i+1])

ans=1
for i in range(N):
    c=mygcd(L[i],R[i])
    ans=max(ans,c)

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

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

for i in range(N):
  print(As.index(i+1) + 1, end = " ")

### FIXED CODE ###

import numpy as np

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

# for i in range(N):
#   print(As.index(i+1) + 1, end = " ")

for item in np.argsort(As):
  print(item+1, end=" ")