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

N, P = map(int, input().split())
d = list(map(int, input())) + [0]
ans =0
for k in range(0,N):
    num = [d[k]]
    for l in range(k+1,N+1):
        nu = int("".join(map(str,num)))
        if nu % P == 0:
            ans += 1
        num.append(d[l])

print(ans)



### FIXED CODE ###

N, P = map(int, input().split())
S = list(map(int, input()))
ans = 0
if P == 2:
    for i in range(N):
        if S[i]%2 == 0:
            ans +=i+1
    print(ans)

elif P ==5:
    for i in range(N):
        if S[i]%5 == 0:
            ans +=i+1
    print(ans)
else:
    data =[0]*P
    tens = 1
    k = 0
    for i in range(N-1,-1,-1):
        k += S[i] *tens %P
        k = k%P
        data[k] += 1
        tens *=10
        tens %=P

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

from collections import deque
DVSR = 1000000007
def LI(): return [int(x) for x in input().split()]
H,W=LI()
MP=[input() for _ in range(H)]
MEMO=[[(-1,0)]*W for _ in range(H)]
MEMO[0][0] = (0,1)
QU=deque([])

QU.append((0,0,0))
IT=[(1,0),(0,1)]
while QU:
    i,j,cost = QU.popleft()
    cost+=1
    pat = MEMO[i][j][1]
    for dy, dx in IT:
        ny, nx = i+dy, j+dx
        if ny < H and ny >= 0 and nx < W and nx >= 0 and MP[ny][nx] == '.':
            cost2, pat2 = MEMO[ny][nx]
            if cost2 == -1:
                MEMO[ny][nx] = (cost, pat)
                QU.append((ny,nx,cost))
            elif cost2 == cost:
                _pat = (pat+pat2)%DVSR
                MEMO[ny][nx] = (cost,_pat)

print(MEMO[H-1][W-1][1])

### FIXED CODE ###

from collections import deque
import sys
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, d=DVSR): return pow(x, d - 2, d)
def DIV(x, y, d=DVSR): return (x * INV(y, d)) % d
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())

H,W=LI()

MP=[input() for _ in range(H)]
MEMO=[[(-1,0)]*W for _ in range(H)]
MEMO[0][0] = (0,1)
QU=deque([])

QU.append((0,0,0))
IT=[(1,0),(0,1)]
while QU:
    i,j,cost = QU.popleft()
    cost+=1
    pat = MEMO[i][j][1]
    for dy, dx in IT:
        ny, nx = i+dy, j+dx
        if ny < H and ny >= 0 and nx < W and nx >= 0 and MP[ny][nx] == '.':
            cost2, pat2 = MEMO[ny][nx]
            if cost2 == -1:
                # print('i:{},j:{},ny:{},nx:{},cost:{},pat:{}'.format(i,j,ny,nx,cost,pat))
                MEMO[ny][nx] = (cost, pat)
                QU.append((ny,nx,cost))
            elif cost2 == cost:
                _pat = (pat+pat2)%DVSR
                MEMO[ny][nx] = (cost,_pat)
                # print('i:{},j:{},ny:{},nx:{},cost:{},pat:{}'.format(i,j,ny,nx,cost,_pat))
                # QU.append((ny,nx,cost,pat))
# for li in MEMO:
    # print(li)
print(MEMO[H-1][W-1][1])
### BUGGY CODE ###

import sys

def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

# だいたいpdfの通り
def main():
    def dot(aa, bb):
        h = len(aa)
        w = len(bb[0])
        res = [[0] * w for _ in range(h)]
        for i, row in enumerate(aa):
            for j, col in enumerate(zip(*bb)):
                res[i][j] = sum(a * b % md for a, b in zip(row, col)) % md
        return res

    l, a, b, md = MI()

    # 数列の要素がk桁になるのがi項目で、k+1桁になるのがj項目
    k = 0
    i = 0
    cc = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
    # 各桁数ごとに処理
    while i < l:
        k += 1
        j = (10 ** k - a + b - 1) // b
        if j == 0: continue
        if j > l: j = l
        # k桁の要素の個数がe
        e = j - i
        # i項目まで連結した整数をans[i],数列のi項目をs[i]とすると
        #                                       [10**k 0 0]
        # [ans[i],s[i],b] = [ans[i-1],s[i-1],b] [  1   1 0]
        #                                       [  0   1 1]
        # 最後の3x3行列をbbとして、e乗すればよいので、最小二乗法でやる
        bb = [[pow(10, k, md), 0, 0], [1, 1, 0], [0, 1, 1]]
        while e:
            if e & 1: cc = dot(cc, bb)
            bb = dot(bb, bb)
            e >>= 1
        i = j

    # bbの累乗からできたccを初期値にかけて、答えを出す
    ans = [[0, a % md, b % md]]
    ans = dot(ans, cc)
    print(ans[0][0])

main()


### FIXED CODE ###

import numpy as np
import sys

def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

# だいたいpdfの通り
def main():
    l,a,b,md=MI()

    # 数列の要素がk桁になるのがi項目で、k+1桁になるのがj項目
    k=0
    i=0
    ans=[0,a%md,b%md]
    ans=np.array(ans,dtype="i8")
    # 各桁数ごとに処理
    while i<l:
        k+=1
        j=(10**k-a+b-1)//b
        if j<=0:continue
        if j>l:j=l
        # k桁の要素の個数がe
        e=j-i
        # i項目まで連結した整数をans[i],数列のi項目をs[i]とすると
        #                                       [10**k 0 0]
        # [ans[i],s[i],b] = [ans[i-1],s[i-1],b] [  1   1 0]
        #                                       [  0   1 1]
        # 最後の3x3行列をbbとして、e乗すればよいので、繰り返し二乗法でやる
        bb=np.zeros((3,3),dtype="i8")
        bb[0,0]=pow(10,k,md)
        bb[1,0]=bb[1,1]=bb[2,1]=bb[2,2]=1
        while e:
            if e&1:ans=np.dot(ans,bb)%md
            bb=np.dot(bb,bb)%md
            e>>=1
        i=j

    print(ans[0])

main()
### BUGGY CODE ###

#import time
#it = time.time()    
#print(d[C-A][D-B] % 998244353)
A, B, C, D = map(int,input().split())

d=[[0 for j in range(D-B+1)] for i in range(C-A+1)]
d[0][0]=1
for i in range(1,C-A+1):
  d[i][0] = B*d[i-1][0] % 998244353
for j in range(1,D-B+1):
  d[0][j] = A*d[0][j-1] % 998244353
#print(time.time()-it)  
for i in range(1,C-A+1):
  for j in range(1,D-B+1):
    #d[i][j]=( (((j+B)*d[i-1][j]) + (i+A)*d[i][j-1])  - ((i+A-1)*((j+B-1)*d[i-1][j-1]) % 998244353)% 998244353)% 998244353
    d[i][j]=((((j+B)*d[i-1][j]) + (i+A)*d[i][j-1])  - ((i+A-1)*((j+B-1)*d[i-1][j-1]) ))% 998244353
    #d[i][j]=d[i-1][j-1]*((i+A)*(j+B)-1)% 998244353
#print(time.time()-it)   
print(d[C-A][D-B] % 998244353)

### FIXED CODE ###

import sys
import numpy as np
#from functools import lru_cache
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
MOD = 998_244_353
 
def main(A, B, C, D):
	d = np.zeros((C + 1, D + 1), np.int64)
	d[A,B]=1
	for i in range(A+1,C+1):
  		d[i,B] = B*d[i-1,B] % MOD
	for j in range(B+1,D+1):
		d[A,j] = A*d[A,j-1] % MOD
 
	for i in range(A+1,C+1):
		for j in range(B+1,D+1):
			d[i,j]=((((j*d[i-1,j]) % MOD + i*d[i,j-1] % MOD) % MOD) -((i-1)*((j-1)*d[i-1,j-1] % MOD)% MOD)% MOD)
    
	return d[C,D] % MOD
          
"""    
    print(d[C][D] % MOD)
    dp = np.zeros((C + 1, D + 1), np.int64)
    dp[C, D] = 1
    for d in range(D, 0, -1):
        dp[C, d - 1] = dp[C, d] * C % MOD
    for c in range(C - 1, -1, -1):
        x = 0
        for d in range(D, -1, -1):
            dp[c, d] = (d * dp[c + 1, d] + x) % MOD
            x += dp[c + 1, d]
            x *= c
            x %= MOD
    return dp[A, B]
"""

if sys.argv[-1] == 'ONLINE_JUDGE':
    import numba
    from numba.pycc import CC
    i8 = numba.from_dtype(np.int64)
    signature = (i8, i8, i8, i8)
 
    cc = CC('my_module')
    cc.export('main', signature)(main)
    cc.compile()
 
from my_module import main
 
A, B, C, D = map(int, read().split())
print(main(A, B, C, D))
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))
Q = int(input())
P = [(0,0)] * Q
for i in range(Q):
	b, c = list(map(int, input().split()))
	P[i] = (b, c)

for i in range(Q):
	for j in range(N):
		if A[j] == P[i][0]:
			A[j] = P[i][1]

	print(sum(A))

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
AA = {}
t = 0
for a in A:
	t += a
	if a in AA:
		AA[a] += 1
	else:
		AA[a] = 1

Q = int(input())
ans = []
for i in range(Q):
	b, c = list(map(int, input().split()))
	if b in AA:
		if c not in AA:
			AA[c] = 0
		AA[c] += AA[b]
		t += (c - b) * AA[b]
		ans += [t]
		del AA[b]
	else:
		ans += [t]
[print(a) for a in ans]
### BUGGY CODE ###

import collections
import sys

n=int(input())
d=list(map(int,input().split()))
m=int(input())
t=list(map(int,input().split()))

c=collections.Counter(t)
cc=list(c.items())
#print(cc)
if n < m:
    print('NO')
else:
    for i in range(len(cc)):
        if d.count(cc[i][0])<cc[i][1]:
            print('NO')
            sys.exit()
    print('YES')

### FIXED CODE ###

import collections
import sys

n=int(input())
d=list(map(int,input().split()))
m=int(input())
t=list(map(int,input().split()))

ct=collections.Counter(t)
cd=collections.Counter(d)
cct=list(ct.items())
#print(cc)
if n < m:
    print('NO')
else:
    for i in range(len(cct)):
        if cd[cct[i][0]]<cct[i][1]:
            print('NO')
            sys.exit()
    print('YES')
### BUGGY CODE ###

def binary_search_ceiling(list, len_list, element):
    i = 0
    j = len_list
    while i <= j:
        k = (i + j) // 2
        if list[0] == element:  # k - 1が0にならないので特例
            return 0
        elif list[k - 1] < element <= list[k]:
            return k
        elif list[k] < element < list[k + 1]:
            return k + 1
        elif list[k] < element:
            i = k  # elementがk番とk+1番の間にあるかもしれないのでi = k + 1 ではなくi = k
        else:
            j = k  # 上と同様に考えてj = k

    return None


def main():
    A, B, Q = map(int, input().split())
    INF = 10 ** 11
    s_list = [-INF] + [int(input()) for i in range(A)] + [INF]
    t_list = [-INF] + [int(input()) for i in range(B)] + [INF]

    len_s = A + 1
    len_t = B + 1

    for i in range(Q):
        xi = int(input())
        ind_s = binary_search_ceiling(s_list, len_s, xi)
        ws = s_list[ind_s - 1]
        es = s_list[ind_s]

        ind_t = binary_search_ceiling(t_list, len_t, xi)
        wt = t_list[ind_t - 1]
        et = t_list[ind_t]

        dist_list = [
                     xi - min(ws, wt),
                     max(es, et) - xi,
                     xi + es - wt * 2,
                     xi + et - ws * 2,
                     (es * 2) - wt - xi,
                     (et * 2) - ws - xi
                     ]

        print(min(dist_list))


if __name__ == "__main__":
    main()


### FIXED CODE ###

import bisect as b


def main():
    A, B, Q = map(int, input().split())
    INF = 10 ** 11
    s_list = [-INF] + [int(input()) for i in range(A)] + [INF]
    t_list = [-INF] + [int(input()) for i in range(B)] + [INF]

    len_s = A + 1
    len_t = B + 1

    for i in range(Q):
        xi = int(input())
        ind_s = b.bisect_left(s_list, xi)
        ws = s_list[ind_s - 1]
        es = s_list[ind_s]

        ind_t = b.bisect_left(t_list, xi)
        wt = t_list[ind_t - 1]
        et = t_list[ind_t]

        dist_list = [
                     xi - min(ws, wt),
                     max(es, et) - xi,
                     xi + es - wt * 2,
                     xi + et - ws * 2,
                     (es * 2) - wt - xi,
                     (et * 2) - ws - xi
                     ]

        print(min(dist_list))


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

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

for i in range(N):
    a ,b = map(int,input().split())
    for i in range(b):
        list.append(a)

list.sort()
print(list[K-1])

### FIXED CODE ###

N , K = map(int,input().split())
cnt =0
get_val = [[0,0]]*N
for i in range(N):
    get_val[i] = list(map(int,input().split()))
get_val.sort()

for i in range(N):
    cnt = cnt + get_val[i][1]
    if cnt >= K:
        print(get_val[i][0])
        break
### BUGGY CODE ###

s = input()
q = int(input())

for i in range(q):
    t = input().split()
    if t[0] == '2':
        if t[1] == '1':
            s = t[2] + s
        else:
            s += t[2]
    else:
        s = s[::-1]

print(s)


### FIXED CODE ###

s = input()
q = int(input())
Flag = False
right=''
left=''

for i in range(q):
    t = input()
    if t[0] == '1':
        Flag = not Flag
    else:
        _, f, c = t.split()
        if Flag == False and f == '2' or Flag == True and f == '1':
            right += c
        else:
            left += c

ans = left[::-1] + s + right
print(ans if not Flag else ans[::-1])
### BUGGY CODE ###

from collections import Counter


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

c=Counter(a)
ck=list(Counter(a).keys())
for i in range(1,n+1):
    if i in ck:
        print(c[i])
    else:
        print(0)

### FIXED CODE ###

from collections import Counter


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



c=Counter(a)
ck=set(Counter(a).keys())
for i in range(1,n+1):
    if i in ck:
        print(c[i])
    else:
        print(0)
### BUGGY CODE ###

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

cnt = 0
tmp = []
for i in range(len(lst)):
    num = lst[i]
    tmp.append(num)
    if num == min(tmp):
        cnt += 1

print(cnt)


### FIXED CODE ###

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

cnt = 0
tmp_min = max(lst)
for i in range(len(lst)):
    num = lst[i]
    if num <= tmp_min:
        cnt += 1
        tmp_min = num

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

S = input()
Q = int(input())
ls = []
count = 0
for i in range(Q):
    ls.append(input())

for i in range(len(ls)):
    if ls[i] == '1':
        try:
            if ls[i+1] == '1':
                count += 1
            else:
                if count == 0:
                    S = S[::-1]
                else:
                    if count %2 == 1:
                        count = 0
                    else:
                        S = S[::-1]
                        count = 0
        except IndexError:
            if count == 0:
                S = S[::-1]
            else:
                if count % 2 == 1:
                    count = 0
                else:
                    S = S[::-1]
                    count = 0

    else:
        ls[i] = [x for x in ls[i]]
        if ls[i][2] == '1':
            S = ls[i][4] + S
        else:
            S = S + ls[i][4]

print(S)

### FIXED CODE ###

s = input()
q = int(input())
qs = [input().split() for i in range(q)]
n = False
left= right = ""
for operation in qs:
    if operation[0] == '1':
        n = not n
    if operation[0] == '2':
        t , f, c = operation
        f = int(f)
        if n:
            f = 1 if f != 1 else 2
        if f == 1:
            left=c+left
        elif f == 2:
            right+=c
s = left+s+right
print(s[::-1] if n else s)
### BUGGY CODE ###

N = int(input())

sum_ = 0
for i in range(1, N + 1):
    n = int(N / i)
    sum_ += (n / 2) * (2 * i + (n - 1) * i)

print(int(sum_))


### FIXED CODE ###

N = int(input())

sum_ = 0
for i in range(1, N + 1):
    n = int(N / i)
    sum_ += (n / 2) * (2 * i + (n - 1) * i)

print(int(sum_))
### BUGGY CODE ###

k,s = map(int,input().split())

cnt = 0

for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if x+y+z == s:
                cnt += 1
    
print(cnt)

### FIXED CODE ###

k,s = map(int,input().split())

c=0

for x in range(k+1):
    for y in range(k+1):
        z = s - x- y
        if 0<=z<=k:
            c+=1
            
                
                
print(c)
### BUGGY CODE ###

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

dp = [float("inf")]*(n)

dp[0] = 0

def chmin(a,b,index):
    if a > b:
        dp[index] = b

for i in range(n-1):
    for j in range(1,k+1):
        chmin(dp[i+j],dp[i] + abs(h[i] - h[i+j]),i+j)
        if i+j >= n-1:
            break
print(dp[n-1])

### FIXED CODE ###

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

dp = [float("inf")]*(n)

dp[0] = 0

def chmin(a,b,index):
    if a > b:
        dp[index] = b

for i in range(n-1):
    for j in range(1,k+1):
        chmin(dp[i+j],dp[i] + abs(h[i] - h[i+j]),i+j)
        if i+j >= n-1:
            break
print(dp[n-1])
### BUGGY CODE ###

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

for x in range(N // R + 1):
    for y in range(N // G + 1):
        check = N - R * x - G * y
        if check % B == 0 and 0 <= check // B <= N // B:
            ans += 1
print(ans)

### FIXED CODE ###

R, G, B, N = map(int, input().split())
ans = 0
 
for Rx in range(0, N+1, R):
    for Gy in range(0, N+1, G):
        check = N - Rx - Gy
        if check % B == 0 and 0 <= check // B <= N // B:
            ans += 1
print(ans)
### BUGGY CODE ###

iteration_count = int(input())
for my_target in range(1,iteration_count+1):
  guess_max_range = int((my_target + 50) ** 0.5)
  number_of_match = 0
  for xx in range(1,guess_max_range):
    xxxx = xx**2
    for yy in range(1,guess_max_range):
      yyyy = yy**2
      xxyy = xx*yy
      for zz in range(1,guess_max_range):
        result = xxxx + yyyy + (zz)**2 + xxyy + (yy)*(zz) + (zz)*(xx)
        if result == my_target:
          number_of_match = number_of_match + 1
  print(number_of_match)

### FIXED CODE ###

nn = int(input())
number_of_match = [0 for _ in range(10005)]
for xx in range(1,105):
  xxxx = xx**2
  for yy in range(1,105):
    yyyy = yy**2
    xxyy = xx*yy
    for zz in range(1,105):
      result = xxxx + yyyy + (zz)**2 + xxyy + (yy)*(zz) + (zz)*(xx)
      if result < 10005:
        number_of_match[result] += 1
for i in range(1,nn+1):
  print(number_of_match[i])
### BUGGY CODE ###

from bisect import bisect_left


def count_inversion(A):
    cnt = 0
    for i in reversed(range(len(A) - 1)):
        j = bisect_left(A, A[i], i + 1, len(A))
        cnt += j - i - 1
        tmp = A[i]
        A[i:j - 1] = A[i + 1:j]
        A[j - 1] = tmp
    return cnt


def main():
    n = int(input())
    A = [int(x) for x in input().split()]
    print(count_inversion(A))


main()



### FIXED CODE ###

#! /usr/local/bin/python3
# coding: utf-8

from math import inf

inv = 0


def merge(A, left, mid, right):
    global inv

    L = A[left:mid]
    L.append(inf)
    R = A[mid:right]
    R.append(inf)
    i = j = 0
    for k in range(left, right):
        if L[i] < R[j]:
            A[k] = L[i]
            i += 1
        else:
            inv += len(L) - i - 1
            A[k] = R[j]
            j += 1


def merge_sort(A, left, right):
    if left + 1 < right:
        mid = (left + right) // 2
        merge_sort(A, left, mid)
        merge_sort(A, mid, right)
        merge(A, left, mid, right)


def main():
    n = int(input())
    A = [int(x) for x in input().split()]
    merge_sort(A, 0, n)
    print(inv)


main()
### BUGGY CODE ###

n, q = map(int, input().split())
s = list(input())
cusum = [0] * n
c = 0
lr = [[int(x) for x in input().split()] for _ in range(q)]
for j in range(q):
    for i in range(n-1):
        cusum[i] = c
        if s[i:i+2] == ["A", "C"]:
            c += 1
            cusum[i+1] = c
    cusum[n-1] = c
    l, r = lr[j]
    print(cusum[r-1] - cusum[l-1])
    cusum = [0] * n
    c = 0


### FIXED CODE ###

n, q = map(int, input().split())
s = list(input())
cusum = [0] * n
c = 0
lr = [[int(x) for x in input().split()] for _ in range(q)]
for i in range(n-1):
    cusum[i] = c
    if s[i:i+2] == ["A", "C"]:
        c += 1
        cusum[i+1] = c
cusum[n-1] = c

for j in range(q):
    l, r = lr[j]
    print(cusum[r-1] - cusum[l-1])
### BUGGY CODE ###

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

count=0
for i in range(0,n-2):
    k=L[i]
    for j in range(i+1,n-1):
        t=L[j]
        if k>=t+L[j+1]:
            break
        for m in range(j+1,n):
            if k>=t+L[m]:
                break
            else:
                count+=1
print(count)


### FIXED CODE ###

n=int(input())
l=list(map(int,input().split()))
l.sort()
def nibuta(a,x):
    h=len(a)
    if a[0]>=x:
        return 0
    elif a[h-1]<x:
        return h
    else:
        lo=-1
        up=h-1
        while up-lo>1:
            if a[(lo+up)//2]>=x:
                up=(lo+up)//2
            else:
                lo=(lo+up)//2
        if a[up]>=x:
            return lo+1
        else:
            return up+1
s=0
for i in range(n-2):
    a1=l[i]
    for j in range(i+1,n-1):
        k=a1+l[j]
        s=s+nibuta(l[j+1:],k)
print(s)
### BUGGY CODE ###

n = int(input())
s = [input() for _ in range(n)]
ans_number = 0

for i in range(n):
  if ans_number < s.count(s[i]):
    ans_number = s.count(s[i])
    
s_max = []
for i in range(n):
  if s.count(s[i]) == ans_number:
    s_max.append(s[i])
    
s_max = list(set(s_max))
s_max.sort()
for i in range(len(s_max)):
  print(s_max[i])

### FIXED CODE ###

from collections import Counter

n = int(input())
s = [input() for _ in range(n)]

c = Counter(s)
c = c.most_common()
ans_number = c[0][1]
c.sort()

for i in range(len(c)):
  if c[i][1] == ans_number:
    print(c[i][0])
### BUGGY CODE ###

N = int(input())

P = []
for i in range(N):
  n = int(input())
  if n in P:
    P.remove(n)
  else:
    P.append(n)

print(len(P))

### FIXED CODE ###

from collections import Counter

N = int(input())
P = []
for i in range(N):
  P.append(int(input()))
  
Pc = Counter(P)

ans = 0
for k, v in Pc.items():
  if v%2 != 0:
    ans += 1
print(ans)
### BUGGY CODE ###

#!/usr/bin/env python3

N = int(input())
S = list(input())

res = 0
for j in range(N):
    rgb = ['R', 'G', 'B']
    second = S[j]
    rgb.remove(second)
    rest_1 = rgb.pop()
    rest_2 = rgb.pop()

    first_1, first_2 = [], []
    for i in range(j):
        if S[i] == second:
            continue
        if S[i] == rest_1:
            first_1.append([rest_1, i])
        if S[i] == rest_2:
            first_2.append([rest_2, i])

    last_1, last_2 = [], []
    for k in range(j + 1, N):
        if S[k] == second:
            continue
        if S[k] == rest_1:
            last_2.append([rest_1, k])
        if S[k] == rest_2:
            last_1.append([rest_2, k])

    for first, i in first_1:
        for last, k in last_1:
            if j - i != k - j:
                # print(f"i = {i}, j = {j}, k = {k}")
                # print(f"first = {first}, second = {second}, last = {last}")
                if i < j < k:
                    res += 1
    for first, i in first_2:
        for last, k in last_2:
            if j - i != k - j:
                # print(f"i = {i}, j = {j}, k = {k}")
                # print(f"first = {first}, second = {second}, last = {last}")
                if i < j < k:
                    res += 1

print(res)


### FIXED CODE ###

#!/usr/bin/env python3

N = int(input())
S = list(input())

n_r, n_g, n_b = 0, 0, 0
for i in range(N):
    if S[i] == 'R':
        n_r += 1
    elif S[i] == 'G':
        n_g += 1
    else:
        n_b += 1
# print(n_r, n_g, n_b)

n_ignore = 0
for i in range(N):
    for j in range(N):
        k = 2 * j - i
        if k >= N:
            continue
        cond_first = i < j < k
        cond_second = S[i] != S[j] and S[i] != S[k] and S[j] != S[k]
        if cond_first and cond_second:
            n_ignore += 1

res = n_r * n_g * n_b - n_ignore
print(res)
### BUGGY CODE ###

count=0
N=int(input())
P=[int(i) for i in input().split()]
for i in range(0,N):
  if min(P[0:i+1])==P[i]:
    count+=1
print(count)

### FIXED CODE ###

import numpy as np
import sys

count=0
N=int(sys.stdin.readline().rstrip())
P=[int(i) for i in sys.stdin.readline().split()]
minval=np.max(P)
for i in range(0,N):
  if minval>=P[i]:
    minval=P[i]
    count+=1
print(count)
### BUGGY CODE ###

from collections import Counter
M=10**7
_,*l=map(int,open(0).read().split())
d=[1]*(M)
C=Counter(sorted(l))
s=0
for a,b in C.items():
    if b != 1:d[a]=0
    elif d[a]:s+=1
    for j in range(a,M,a):d[j]=0
print(s)


### FIXED CODE ###

from collections import Counter
def i(): return int(input())
def l(): return list(map(int,input().split()))
N = i();A = l();A.sort();dp = [1]*(10**6+1);C = Counter(A);ans = 0
for a,b in C.items():
    if b != 1:dp[a] = 0
    elif dp[a]:ans += 1
    for j in range(a,10**6+1,a):dp[j] = 0
print(ans)