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

N = int(input())
P = list(map(int, input().split()))
answer = 1
for i in range(1, N):
    MIN = min(P[0:i])
    if MIN > P[i]:
        answer += 1

print(answer)

### FIXED CODE ###

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

def init_min(init_min_val):
    #set_val
    for i in range(N):
        seg_min[i+num_min-1]=init_min_val[i]    
    #built
    for i in range(num_min-2,-1,-1) :
        seg_min[i]=min(seg_min[2*i+1],seg_min[2*i+2]) 
    
def update_min(k,x):
    k += num_min-1
    seg_min[k] = x
    while k:
        k = (k-1)//2
        seg_min[k] = min(seg_min[k*2+1],seg_min[k*2+2])
    
def query_min(p,q):
    if q<=p:
        return ide_ele_min
    p += num_min-1
    q += num_min-2
    res=ide_ele_min
    while q-p>1:
        if p&1 == 0:
            res = min(res,seg_min[p])
        if q&1 == 1:
            res = min(res,seg_min[q])
            q -= 1
        p = p//2
        q = (q-1)//2
    if p == q:
        res = min(res,seg_min[p])
    else:
        res = min(min(res,seg_min[p]),seg_min[q])
    return res

#####単位元######
ide_ele_min = 10**10

#num_min:n以上の最小の2のべき乗
num_min =2**(N-1).bit_length()
seg_min=[ide_ele_min]*2*num_min
init_min(P)

answer = 1

for i in range(1, N):
    MIN = query_min(0, i)
    if MIN > P[i]:
        answer += 1

print(answer)
### BUGGY CODE ###

class Node():
    def __init__(self, data):
        # string
        self.data = data
        self.children = dict()
        
class Tries():
    def __init__(self):
        self.head = Node("*")

    def add(self, string):
        nodelist = [Node(char) for char in string]
        cur_node = self.head
        for node in nodelist:
            char = node.data
            if char not in cur_node.children:
                cur_node.children[char] = node
                cur_node = cur_node.children[char]
            else:
                cur_node = cur_node.children[char]
        cur_node.children["*"] = 0

    def _add(self, string):
        '''
        deprecated
        '''
        
        nodelist = [Node(char) for char in string]
        cur_node = self.head
        i = 0
        
        while(i < len(nodelist)):
            node = nodelist[i]
            char = node.data
            
            if char not in cur_node.children:
                cur_node.children[char] = nodelist[i]
                cur_node = cur_node.children[char]

            else:
                # cur_node.children[char]
                cur_node = cur_node.children[char]

            i += 1
            
    def find(self, string):
        i = 0
        cur_node = self.head
        while(i <= len(string)-1):
            
            char = string[i]
            if char in cur_node.children:
                cur_node = cur_node.children[char]
                i += 1
            else:
                return False
        if cur_node.children.get("*") == None:
            return False
        return True
                
if __name__ == "__main__":
    
    n = int(input())
    ops = []
    words = []
    for _ in range(n):
        op, word = input().split()
        ops.append(op)
        words.append(word)
    
    tries = Tries()
    for op, word in zip(ops, words):
        if op=='insert':
            tries.add(word)
        else:
            if tries.find(word)==True:
                print("yes")
            else:
                print("no")



### FIXED CODE ###

if __name__ == "__main__":
    
    n = int(input())
    ops = []
    words = []
    for _ in range(n):
        op, word = input().split()
        ops.append(op)
        words.append(word)
    
    db = set()
    for op, word in zip(ops, words):
        if op=='insert':
            db.add(word)
        else:
            if word in db:
                print("yes")
            else:
                print("no")
### BUGGY CODE ###

import fractions

from functools import reduce
K=int(input())

def gcd_list(numbers):
  return reduce(fractions.gcd, numbers)


count=0
for i in range(1,K+1):
  for j in range(i,K+1):
    for k in range(j,K+1):
      if i==j and j==k and k==i:
        n=1
      elif i==j or j==k or k==i:
        n=3
      else:
        n=6
      count+=n*gcd_list([i,j,k])

print(count)

### FIXED CODE ###

import math

from functools import reduce
K=int(input())

def gcd_list(numbers):
  return reduce(math.gcd, numbers)


count=0
for i in range(1,K+1):
  for j in range(i,K+1):
    for k in range(j,K+1):
      if i==j and j==k and k==i:
        n=1
      elif i==j or j==k or k==i:
        n=3
      else:
        n=6
      count+=n*gcd_list([i,j,k])

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

n = int(input())
l = list(map(int,input().split()))
l1 = [] #odd *-1
l2 = [] #even *-1
ans = []
for i in range(n):
    if i%2:
        l1.append(-1*l[i])
    else:
        l1.append(l[i])

for j in range(n):
    if j%2:
        l2.append(l[j])
    else:
        l2.append(-1*l[j])

for k in range(n):
    if k%2:
        ans.append(sum(l2[k:])+sum(l1[:k]))
    else:
        ans.append(sum(l1[k:])+sum(l2[:k]))

print(' '.join(map(str,ans)))

### FIXED CODE ###

from itertools import accumulate
n = int(input())
l = list(map(int,input().split()))
l1 = [] #odd *-1
l2 = [] #even *-1
ans = []
for i in range(n):
    if i%2:l1.append(-1*l[i])
    else:l1.append(l[i])
for j in range(n):
    if j%2:l2.append(l[j])
    else:l2.append(-1*l[j])

a = [0]+list(accumulate(l2[::-1]))
b = [0]+list(accumulate(l1))
c = [0]+list(accumulate(l1[::-1]))
d = [0]+list(accumulate(l2))
for k in range(n):
    if k%2:
        ans.append(a[~k]+b[k])
    else:
        ans.append(c[~k]+d[k])

print(' '.join(map(str,ans)))
### BUGGY CODE ###

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

asum = sum(a)
gcdmax = int(math.sqrt(asum))


ans = 1
# print(a)

for i in range(2,asum+1):
    b = [a[ii] % i for ii in range(n)]
    b.sort()
#     print(i,b)
    l = 0
    r = 0
    x = 0
    y = n-1
    while x<=y:
        if r>=l:
            l += b[x]
            x += 1
        else:
            r += i - b[y]
            y -= 1
#         print(l,r)
    if max(l,r) <= k and (l-r)%i==0 :
        ans = i

print(ans)

### FIXED CODE ###

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

asum = sum(a)
gcdmax = int(math.sqrt(asum))
li = []
for i in range(2,gcdmax+1):
    if asum%i==0:
        li.append(i)
for i in range(gcdmax,0,-1):
    if asum%i==0:
        li.append(asum//i)


ans = 1
# print(li)

for i in li:
    b = [a[ii] % i for ii in range(n)]
    b.sort()
#     print(i,b)
    l = 0
    r = 0
    x = 0
    y = n-1
    while x<=y:
        if r>=l:
            l += b[x]
            x += 1
        else:
            r += i - b[y]
            y -= 1
#         print(l,r)
    if max(l,r) <= k and (l-r)%i==0 :
        ans = i

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

N = int(input())
X = [0]*N
L = [0]*N
XpL = [0]*N
XmL = [0]*N
cnt = 0
for i in range(N):
    X[i], L[i] = map(int, input().split())
    XpL[i] = X[i]+L[i]
    XmL[i] = max(0, X[i]-L[i])
    
    for j in range(i):
        if(XmL[i] < XpL[j] and XmL[j] < XpL[i]):
            cnt += 1
            XpL[i] = XpL[j]
            XmL[i] = XmL[j]
print(N-cnt)

### FIXED CODE ###

import sys
N = int(input())
a = sorted([(x+l, x-l) for x, l in (map(int, l.split()) for l in sys.stdin)])

last = a[0][0]
ans = 1

for r, l in a[1:]:
    if(last <= l):
        ans += 1
        last = r
print(ans)
### BUGGY CODE ###

n, m = map(int,input().split())
a = list(map(int,input().split()))
for k in range(m):
  a.sort()
  s, t = map(int,input().split())
  for i in range(s):
    if a[i] < t:
      a[i] = t
    else:
      break
ans = 0
for v in range(n):
  ans += a[v]
print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline
n,m = map(int,input().split())
a = list(map(int,input().split()))
a.sort()
b = [list(map(int,input().split())) for p in [0]*m]
b.sort(key=lambda q: -q[1])
#print(a)
#print(b)

c = 0
for s in b:
	for t in [0]*s[0]:
		#print(s)
		if c + 1 > n:
			break
		if s[1] <= a[c]:
			break
		a[c] = s[1]
		c += 1
		#print(a)
	else:
		continue
	break
print(sum(a))
### BUGGY CODE ###

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

lenums = int(input())
nums = [int(i) for i in input().split()]
answer = 0

ans = [sum([1 for j in range(i + 1, lenums + 1) if sum(nums[i:j]) == 0]) for i in range(lenums)]
answer = sum(ans)

print(answer)


### FIXED CODE ###

# -*- coding: utf-8 -*-
import collections
import math

lenums = int(input())
nums = [int(i) for i in input().split()]
answer = 0

dp = [0]

for i in range(lenums):
    dp.append(dp[i] + nums[i])

count_dict = collections.Counter(dp)
for i in count_dict.values():
    if i <= 1:
        continue
    answer = answer + i * (i - 1) // 2 # xC2

print(answer)
### BUGGY CODE ###

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

cnt = 0
for i in range(1000):
	sec = str(i).zfill(3)
	nex = 0
	for j in range(n):
		if nex == 0 and s[j] == sec[0]:
			nex += 1
		elif nex == 1 and s[j] == sec[1]:
			nex += 1
		elif nex == 2 and s[j] == sec[2]:
			cnt += 1
			break
print(cnt)


### FIXED CODE ###

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

cnt = 0
for i in range(1000):
	sec = str('%03d' % i)
	if sec[0] in s and sec[1] in s and sec[2] in s:
		nex = 0
		for j in range(n):
			if nex == 0 and s[j] == sec[0]:
				nex += 1
			elif nex == 1 and s[j] == sec[1]:
				nex += 1
			elif nex == 2 and s[j] == sec[2]:
				cnt += 1
				break
print(cnt)
### BUGGY CODE ###

import bisect
import sys
input=sys.stdin.readline
n,d,a=map(int,input().split())
l=[list(map(int,input().split())) for i in range(n)]
l.sort()
x=[];h=[]
for i in range(n):
  x.append(l[i][0])
  h.append(l[i][1])

Right=[]
for i in range(n):
  Right.append(bisect.bisect_right(x,x[i]+2*d))

LV=(n-1).bit_length()
N0=2**LV
data=[0]*(2*N0)
lazy=[0]*(2*N0)

def gindex(l,r):
  L=l+N0;R=r+N0
  lm=(L//(L&-L))>>1
  rm=(R//(R&-R))>>1
  while L<R:
    if R<=rm:
      yield R
    if L<=lm:
      yield L
    L>>=1;R>>=1
  while L:
    yield L
    L>>=1

def propagates(*ids):
  for i in reversed(ids):
    v=lazy[i-1]
    if not v:
      continue
    lazy[2*i-1]+=v;lazy[2*i]+=v
    data[2*i-1]+=v;data[2*i]+=v
    lazy[i-1]=0

def update(l,r,x):
  L=N0+l;R=N0+r
  while L<R:
    if R&1:
      R-=1
      lazy[R-1]+=x;data[R-1]+=x
    if L&1:
      lazy[L-1]+=x; data[L-1]+=x
      L+=1
    L>>=1;R>>=1
  for i in gindex(l,r):
    data[i-1]=min(data[2*i-1],data[2*i])+lazy[i-1]

def query(l,r):
  propagates(*gindex(l,r))
  L=N0+l;R=N0+r

  s=float('inf')
  while L<R:
    if R&1:
      R-=1
      s=min(s,data[R-1])
    if L&1:
      s=min(s,data[L-1])
      L+=1
    L>>=1; R>>=1
  return s

for i in range(n):
  update(i,i+1,h[i])

p=0
ans=0
while p<n:
  x=query(p,p+1)
  update(p,Right[p],-((x+a-1)//a)*a)
  ans+=(x+a-1)//a
  while query(p,p+1)<=0:
    p+=1
    if p==n:
      break
print(ans)

### FIXED CODE ###

import bisect
import sys
input=sys.stdin.readline
n,d,a=map(int,input().split())
l=[list(map(int,input().split())) for i in range(n)]
l.sort()

data0=[0]*(n+1)
data1=[0]*(n+1)

def _add(data,k,x):
  while k<=n:
    data[k]+=x
    k+=k&-k

def add(l,r,x):
  _add(data0,l,-x*(l-1))
  _add(data0,r,x*(r-1))
  _add(data1,l,x)
  _add(data1,r,-x)

def _get(data,k):
  s=0
  while k:
    s+=data[k]
    k-=k&-k
  return s

def query(l,r):
  return _get(data1,r-1)*(r-1)+_get(data0,r-1)-_get(data1,l-1)*(l-1)-_get(data0,l-1)

x=[]
for i in range(n):
  x.append(l[i][0])
  add(i+1,i+2,l[i][1])

Right=[]
for i in range(n):
  Right.append(bisect.bisect_right(x,x[i]+2*d))

p=0
ans=0
while p<n:
  Q=query(p+1,p+2)
  add(p+1,Right[p]+1,-((Q+a-1)//a)*a)
  ans+=(Q+a-1)//a
  p=min(p+1,n-1)
  while query(p+1,p+2)<=0:
    p+=1
    if p==n:
      break
print(ans)
### BUGGY CODE ###

n = int(input())
d_lis = [int(d) for d in input().split()]
cnt = 0
ans = 0
for i in range(max(d_lis)+1):
    cnt += d_lis.count(i)
    if cnt == n // 2:
        ans += 1
print(ans)

### FIXED CODE ###

n = int(input())
d_lis = list(map(int,input().split()))
li = sorted(d_lis)
mid = n // 2
print(li[mid] - li[mid-1])
### BUGGY CODE ###

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

def binary(l,i):
  r=N-1
  while l<=r:
    m=(l+r)//2
    if A[m]==i:
      return A[m]
    elif A[m]>i:
      r=m-1
    else:
      l=m+1
  x=abs(A[m]-i)
  for j in range(max(0,m-2),min(m+3,N)):
    if x >= abs(A[j]-i):
      res = A[j]
      x=abs(A[j]-i)
  return res

def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result
maximum=0
for i in range(N-1):
  c = binary(i+1,A[i]/2)
  cmb_i=cmb(A[i],c)
  if maximum<cmb_i:
    ans1=A[i];ans2=c
    maximum=cmb_i

print(ans1,ans2)
  
    

### FIXED CODE ###

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

def binary(l,i):
  r=N-1
  while l<=r:
    m=(l+r)//2
    if A[m]==i:
      return A[m]
    elif A[m]>i:
      r=m-1
    else:
      l=m+1
  x=abs(A[m]-i)
  for j in range(max(0,m-2),min(m+3,N-1)):
    if x >= abs(A[j]-i):
      res = A[j]     
      x=abs(A[j]-i)
  return res


print(A[-1],binary(1,A[-1]/2))
### BUGGY CODE ###

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

ans = 1
for i in ls:
    ans *= i

if ans > 10**18:
    print("-1")
else:
    print(ans)

### FIXED CODE ###

import math
n = int(input())
li = sorted(list(map(int,input().split())), reverse = True)

if 0 in li:
    print(0)
else:
    ans = 1
    limit = 10**18
    for i in range(n):
        if li[i] > limit:
            ans = -1
            break
        else:
            ans = ans * li[i]
            limit = limit/li[i]
    if ans > 10**18:
        ans = -1
    print(ans)
### BUGGY CODE ###

n,m=map(int,input().split())
xy = [map(int, input().split()) for _ in range(m)]
x, y = [list(i) for i in zip(*xy)]
ans=0

l=[-1]*n

def rootfind(a):
    while 1:
        if l[a-1]>0:
            a=l[a-1]
        else:
            break
    return a


def rootunion(c,d):
    cr=rootfind(c)
    dr=rootfind(d)
    if cr==dr:
        pass
    else:
        l[cr-1]=dr


for j in range(m):
    p=x[j]
    q=y[j]
    rootunion(p,q)

for o in l:
    if o<0:
        ans+=1

print(ans-1)

### FIXED CODE ###

n,m=map(int,input().split())
xy = [map(int, input().split()) for _ in range(m)]
x, y = [list(i) for i in zip(*xy)]
ans=0

l=[-1]*n

def rootfind(a):
    changelist=[]
    while 1:
        if l[a-1]>0:
            changelist.append(a)
            a=l[a-1]
        else:
            break
    for e in changelist:
        l[e-1]=a
    return a


def rootunion(c,d):
    cr=rootfind(c)
    dr=rootfind(d)
    if cr==dr:
        pass
    else:
        l[cr-1]=dr


for j in range(m):
    p=x[j]
    q=y[j]
    rootunion(p,q)

for o in l:
    if o<0:
        ans+=1

print(ans-1)
### BUGGY CODE ###

from collections import Counter
n = int(input())
a = list(map(int, input().split()))
c = Counter(a)
dp = [True] * (10 ** 6 + 1)
s = list(set(a))
for x in s:
    e = x * 2
    # エラトステネスの篩
    while e <= 10 ** 6:
        dp[e] = False
        e += x
ret = 0
for x in a:
    # 重複なし and 約数なし
    if c[x] == 1 and dp[x] == True:
        ret += 1
print(ret)

### FIXED CODE ###

from collections import Counter
n = int(input())
a = list(map(int, input().split()))
c = Counter(a)
dp = [True] * (10 ** 6 + 1)
s = list(set(a))
for x in s:
    e = x * 2
    while e <= 10 ** 6:
        dp[e] = False
        e += x
ret = 0
for x in a:
    if c[x] == 1 and dp[x] == True:
        ret += 1
print(ret)
### BUGGY CODE ###

import sys
import collections
sys.setrecursionlimit(10 ** 6)
d = collections.defaultdict(list)
def alg_memoization_recursion(f):
    mt = 0
    for v in d[f]:
        mt = max(mt, alg_memoization_recursion(v) + 1)
    return mt


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n, m = list(map(int, readline().split()))
    for i in range(m):
        x, y = list(map(int, readline().split()))
        d[x-1] += [y-1]
    mt = 0
    for i in range(n):
        mt = max(mt, alg_memoization_recursion(i))
    print(mt)


if __name__ == '__main__':
    solve()


### FIXED CODE ###

import sys
import collections
from functools import lru_cache

xy = []
d = collections.defaultdict(list)
@lru_cache(maxsize=None)
def alg_memoization_recursion(f):
    mt = 0
    for v in d[f]:
        mt = max(mt, alg_memoization_recursion(v) + 1)
    return mt


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    sys.setrecursionlimit(10 ** 5 + 1)
    n, m = list(map(int, readline().split()))
    for i in range(m):
        x, y = list(map(int, readline().split()))
        d[x-1] += [y-1]
    mt = 0
    for i in range(n):
        mt = max(mt, alg_memoization_recursion(i))
    print(mt)


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

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

for i in range(N):
    for j in range(i+1, N):
        for k in range(j+1, N):
            if j-i == k-j:
                continue
            if S[i] != S[j] and S[i] != S[k] and S[j] != S[k]:
                ans += 1

print(ans)

### FIXED CODE ###

from collections import Counter

N = int(input())
S = input()
index = Counter(S)
ans = index["R"]*index["G"]*index["B"]

for diff in range(1, N//2 +1):
    for i in range(N):
        j = i +diff
        k = j +diff
        if k >= N:
            break
        if S[i] != S[j] and S[i] != S[k] and S[j] != S[k]:
            ans -= 1
print(ans)
### BUGGY CODE ###

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 19
MOD = 10 ** 9 + 7

def bisearch_min(mn, mx, func):
    """ 条件を満たす最小値を見つける二分探索 """

    ok = mx
    ng = mn
    while ng+1 < ok:
        mid = (ok+ng) // 2
        if func(mid):
            ok = mid
        else:
            ng = mid
    return ok

N, K = MAP()
A = LIST()
B = LIST()
A.sort()
B.sort(reverse=1)

def check(m):
    C = [0] * N
    for i in range(N):
        C[i] = m // B[i]
    res = 0
    for i in range(N):
        res += max(A[i] - C[i], 0)
    return res <= K

res = bisearch_min(-1, INF, check)
print(res)


### FIXED CODE ###

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

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 7)
INF = 10 ** 18
MOD = 10 ** 9 + 7

def bisearch_min(mn, mx, func):
    """ 条件を満たす最小値を見つける二分探索 """

    ok = mx
    ng = mn
    while ng+1 < ok:
        mid = (ok+ng) // 2
        if func(mid):
            # 下を探しに行く
            ok = mid
        else:
            # 上を探しに行く
            ng = mid
    return ok

N, K = MAP()
A = LIST()
B = LIST()

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

def check(m):
    k = 0
    for i, a in enumerate(A):
        b = B[i]
        k += max(ceil(a - m/b), 0)
        if k > K:
            return False
    return True

print(bisearch_min(-1, INF, check))
### BUGGY CODE ###

def abc097_c():
    S = str(input())
    K = int(input())
    subs = set()

    for n in range(1, len(S)+1):
        for i in range(0, len(S)-n+1):
            subs.add(S[i: i+n])

    subs_asc = sorted(list(subs))
    ans = subs_asc[K-1]
    print(ans)

abc097_c()

### FIXED CODE ###

def abc097_c():
    S = str(input())
    K = int(input())
    subs = set()

    for i in range(len(S)):
        for j in range(i+1, min(len(S)+1, i+K+1)):
            subs.add(S[i:j])

    subs_asc = sorted(list(subs))
    ans = subs_asc[K-1]
    print(ans)

abc097_c()
### BUGGY CODE ###

N = int(input())
A = list(map(int,input().split()))
l = []
for i in range(1,N+1):
    l.append(A.count(i))
    if sum(l)==N-1:
        break
for i in range(len(l)):
    print(l[i])
for _ in range(N-len(l)):
    print(0)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
l = []
for _ in range(N):
    l.append(0)
for i in A:
    l[i-1] +=1
for x in l:
    print(x)
### BUGGY CODE ###

n, p = map(int, input().split())
s = input()
count = 0
for i in range(n):
    for j in range(i + 1, n + 1):
        sub_s = int(s[i:j])
        if sub_s % p == 0:
            count += 1
print(count)

### FIXED CODE ###

n, p = map(int, input().split())
s = input()
sum_count = 0
if p in {2, 5}:
    for right in range(n):
        if int(s[right]) % p == 0:
            sum_count += (right + 1)
else:
    modp_count = [0] * p
    modp_count[0] = 1
    subs_modp, pow = 0, 1
    for si in s[::-1]:
        subs_modp += ((int(si)*pow) % p)
        subs_modp %= p
        modp_count[subs_modp] += 1
        pow = (pow*10) % p
        
    for count in modp_count:
        sum_count += count*(count - 1) // 2
print(sum_count)
### BUGGY CODE ###

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

#r=s.count('R')
#g=s.count('G')
#b=s.count('B')

r,g,b=0,0,0

for i in range(0,n):
  if s[i]=='R':
    r+=1
  elif s[i]=='G':
    g+=1
  else:
    b+=1

ng=0

all=r*g*b

#NGパターン数の洗い出し
for i in range(0,n-2):
  for j in range(i,n-1):
    if s[i]==s[j]:
      continue
    else:
      if j*2-i<=n-1:
#        print(i,j,j*2-i)
        if s[j]!=s[j*2-i] and s[j*2-i]!=s[i]:
          ng+=1
print(all-ng)

### FIXED CODE ###

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

#r=s.count('R')
#g=s.count('G')
#b=s.count('B')

r,g,b=0,0,0

for i in range(0,n):
  if s[i]=='R':
    r+=1
  elif s[i]=='G':
    g+=1
  else:
    b+=1

ng=0

all=r*g*b

#NGパターン数の洗い出し
for i in range(0,n-2):
  for j in range(i,n-1):
    if s[i]==s[j]:
      continue
    else:
      if j*2-i<=n-1:
#        print(i,j,j*2-i)
        if s[j]!=s[j*2-i] and s[j*2-i]!=s[i]:
          ng+=1
print(all-ng)
### BUGGY CODE ###

from collections import deque

INF = float("inf")

H, W, K = map(int, input().split())
A = [list(input()) for _ in range(H)]

Si, Sj = (0, 0)
for i, a in enumerate(A):
    if "S" in a:
        Si, Sj = (i, a.index("S"))
        A[Si][Sj] = "."
        break

distance = INF

Q = deque([(0, Si, Sj)])
while Q:
    cnt, i, j = Q.popleft()

    if A[i][j] == "#":
        continue
    A[i][j] = "#"

    distance = min(distance, i, j, H - i - 1, W - j - 1)

    if cnt >= K:
        continue

    for ni, nj in ((i + 1, j), (i, j + 1), (i - 1, j), (i, j - 1)):
        if 0 <= ni < H and 0 <= nj < W and A[ni][nj] == ".":
            Q.append((cnt + 1, ni, nj))

print(-(-distance // K) + 1)


### FIXED CODE ###

from collections import deque

INF = float("inf")

H, W, K = map(int, input().split())
A = [list(input()) for _ in range(H)]

Si, Sj = (0, 0)
for i, a in enumerate(A):
    if "S" in a:
        Si, Sj = (i, a.index("S"))
        break

dist = [[INF] * W for _ in range(H)]
dist[Si][Sj] = 0


ans = INF

Q = deque([(Si, Sj)])
while Q:
    i, j = Q.popleft()

    ans = min(
        ans,
        1 + (i + K - 1) // K,
        1 + (j + K - 1) // K,
        1 + (H - 1 - i + K - 1) // K,
        1 + (W - 1 - j + K - 1) // K
    )

    if dist[i][j] == K:
        continue

    distance = dist[i][j] + 1

    for di, dj in ((1, 0), (0, 1), (-1, 0), (0, -1)):
        ni, nj = i + di, j + dj

        if not (0 <= ni < H and 0 <= nj < W and A[ni][nj] == "."):
            continue

        A[ni][nj] = "#"

        if dist[ni][nj] > distance:
            dist[ni][nj] = distance
            Q.append((ni, nj))

print(ans)