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

import numpy as np

N = int(input())
An = list(map(int, input().split()))
ok = [False] * N
ng = set()
a_An = np.array(An)
for i, a in enumerate(An):
    temp = a_An / a
    temp[i] = 0.1
    check = (temp % 1 == 0)
    ok = ok | check
    # print(ok)
    # check = np.delete(check, np.where(check == i))
    # check = check[check != i]
    # if len(check) > 0:
    #     ng = ng | set(check)
ok = list(ok)
print(ok.count(0))


### FIXED CODE ###

N = int(input())
An = list(map(int, input().split()))
An.sort()
max_n = max(An)
dp = [0] * (max_n + 1)
for i in range(N):
    if dp[An[i]] != 0:
        dp[An[i]] = 2
        continue
    for j in range(1, max_n//An[i] + 1):
        dp[An[i]*j] += 1
ans = 0
for a in An:
    if dp[a] == 1:
        ans += 1
print(ans)
### BUGGY CODE ###

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

ans = 0
for i in range(N-K+1):
    p = pn[i:i+K]
    if ans < sum(p):
        maxlist = p
        ans = sum(p)

ans = (sum(maxlist)+int(len(maxlist)))/2
print('{:.12f}'.format(ans))



### FIXED CODE ###

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

pn_t = [0]
for i in range(N):
    pn_t.append(pn[i]+pn_t[i])

l = 0
for i in range(N-K+1):
    l = max(l, pn_t[K+i]-pn_t[i])
ans = (l+K)/2
print(ans)
### BUGGY CODE ###

from collections import deque


class dfs():
    
    def __init__(self, n, el):
        self.n = n
        self.el = el

        self.evenl = [0 for i in range(n)]
        self.neibors = dict([(i,[]) for i in range(n)])


    def calc(self, nf):
        used = []
        used.append( nf )
        stack = deque([ nf ])
        while( len(stack) != 0 ):
            current = stack.popleft()
            current_dist = self.evenl[current]
            for neibor in self.neibors[current]:
                neibor_n, neibor_w = neibor
                if neibor_n not in used:
                    used.append( neibor_n )
                    stack.append( neibor_n )
                    self.evenl[neibor_n] = self.xor( neibor_w, current_dist )                        

    def xor(self, x1,x2):
        return (x1 + x2) % 2

    def set_neibors(self):
        for e in self.el:
            u,v,w = e
            self.neibors[u-1].append( (v-1,w%2) )
            self.neibors[v-1].append( (u-1,w%2) )


n = int(input())
el = []
for i in range(n-1):
    u,v,w = map( int, input().split() )
    el.append( (u,v,w) )    

m = dfs(n,el)
m.set_neibors()
m.calc(0)

for item in m.evenl:
    print(item)

### FIXED CODE ###

from collections import deque

n = int(input())
neibors = [[] for i in range(n)]
for i in range(n-1):
    u,v,w = map( int, input().split() )
    neibors[u-1].append( (v-1,w%2) )
    neibors[v-1].append( (u-1,w%2) )

dist = [-1 for i in range(n)]
stack = deque([0])
while( len(stack) != 0 ):
    current = stack.popleft()
    current_dist = dist[current]

    for neibor_n, neibor_w in neibors[current]:
        if dist[neibor_n] == -1:
            stack.append( neibor_n )
            dist[neibor_n] = (neibor_w + current_dist) % 2  

for item in dist:
    print(item)
### BUGGY CODE ###

N, M = map(int,input().split())
A = list(map(int,input().split()))
BC = [list(map(int,input().split())) for _ in range(M)]

res = []
for B, C in BC:
  for _ in range(B):
    res.append(C)

X = A+res
X.sort(reverse = True)
print(sum(X[:N]))

### FIXED CODE ###

N, M = map(int,input().split())
A = list(map(int,input().split()))
BC = [list(map(int,input().split())) for _ in range(M)]
BC.sort(key = lambda x: -x[1])

for B, C in BC:
  A.extend([C]*B)
  if len(A) > N*2:
    break
A.sort(reverse = True)
print(sum(A[:N]))
### BUGGY CODE ###

n = int(input())
a = [int(i) for i in input().split()]
b = []
for i in range(n):
    ans = 0
    for j in range(n):
        if j == i:
            ans += a[j % n]
        elif (j == i-1) | (j == n+i-1):
            ans += a[j % n]
        elif (j > i):
            if j % 2 != i % 2:
                ans -= a[j % n]
            else:
                ans += a[j % n]
        elif (j < i):
            if j % 2 != i % 2:
                ans += a[j % n]
            else:
                ans -= a[j % n]
    b.append(str(ans))
print(" ".join(b))

### FIXED CODE ###

n = int(input())
a = [int(i) for i in input().split()]
ans = [a[i] if (i % 2 == 0) else -1 * a[i] for i in range(n)]
b = []
ans0 = sum([a[i] if (i % 2 == 0) else -1 * a[i] for i in range(n)])
b.append(str(ans0))
temp = int(ans0 // 2)
for i in range(0, n-1):
    k = a[i] - temp
    b.append(str(k*2))
    temp = k
print(' '.join(b))
### BUGGY CODE ###

def print_list(n, s, list_q):
    list_q[1] = n - list_q[1]
    for i in range(list_q[0] - 1):
        s = s[1:]
    for i in range(list_q[1]):
        s = s[:-1]
    s = s.split("AC")
    print(len(s) - 1)


n, q = map(int, input().split())
s = input()
for i in range(q):
    print_list(n, s, list(map(int, input().split())))


### FIXED CODE ###

import sys
input = sys.stdin.readline
N, Q = map(int,input().split())
S = list(input())[:-1]
list_Sum = [0]*(N+1)
for i in range(1, N):
    list_Sum[i+1] = list_Sum[i]
    if S[i-1] == "A" and S[i] == "C":
        list_Sum[i+1] += 1
for i in range(Q):
    l, r = map(int,input().split())
    print(list_Sum[r]-list_Sum[l])
### BUGGY CODE ###

import bisect
n, m = map(int, input().split())
arr = sorted(list(map(int, input().split())))
ope = []
d = []
for i in range(m):
    ope.append(list(map(int,input().split())))
ope = sorted(ope,key = lambda x:-x[1])
for b,c in ope:
    if len(d) == n:
        break
    elif len(d) + b > n:
        d  = d + [c]*(n-len(d))
    else:
        d = d + [c]*b
d.reverse()
arr = sorted(arr,reverse = True)
x = [0]*(n+1)
x[0] = sum(arr)
for i in range(1,n+1):
    t_arr = arr.pop()
    if d:
        t_d = d.pop()
    else:
        t_d = t_arr
    x[i] = x[i-1] + t_d - t_arr
print(max(x))

### FIXED CODE ###

import bisect
n, m = map(int, input().split())
arr = sorted(list(map(int, input().split())))
ope = []
d = []
for i in range(m):
    ope.append(list(map(int,input().split())))
ope = sorted(ope,key = lambda x:-x[1])
i = 0
ok = True
for b,c in ope:
    for rep in range(b):
        if i >= n or arr[i] > c:
            ok = False
            break
        arr[i] = c
        i += 1
    if ok:
        continue
    else:
        break
print(sum(arr))
### BUGGY CODE ###

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

count = 0
for i in range(N):
    for j in range(i+1, N):
        if A[i] == A[j]:
            count = count + 1
            print("NO")
            break

if count == 0:
    print("YES")


### FIXED CODE ###

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

A.sort()
count = 0

for i in range(1, N):
    if A[i-1] == A[i]:
        count += 1
        break

if count == 0:
    print("YES")
else:
    print("NO")
### BUGGY CODE ###

import sys
input = sys.stdin.readline

S = input().strip()
Q = int(input())
QUERY = [input().split() for _ in range(Q)]

rev = False

for query in QUERY:
    # 反転の操作
    if query[0] == '1':
        if rev:
            rev = False
        else:
            rev = True
    else:
        # 先頭に追加する場合
        if query[1] == '1':
            # 反転しているとき
            if rev:
                # 末尾に追加
                S = S + query[2]
            # 反転していないとき
            else:
                # 先頭に追加
                S = query[2] + S
        # 末尾に追加する場合
        else:
            # 反転しているとき
            if rev:
                # 先頭に追加
                S = query[2] + S
            # 反転していないとき
            else:
                # 末尾に追加
                S = S + query[2]
if rev:
    print(S[::-1])
else:
    print(S)

### FIXED CODE ###

S = input()
Q = int(input())
Query = [input().split() for _ in range(Q)]

rev = False
S1 = ''
S2 = ''

for TFC in Query:
    if TFC[0] == '1':
        rev = not rev
    else:
        if TFC[1] == '1':
            if rev:
                S2 += TFC[2]
            else:
                S1 = TFC[2] + S1
        else:
            if rev:
                S1 = TFC[2] + S1
            else:
                S2 += TFC[2]

if rev:
    print(S2[::-1] + S[::-1] + S1[::-1])
else:
    print(S1 + S + S2)
### BUGGY CODE ###

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

magic = [tuple(map(int, input().split())) for _ in range(N)]

DP = [0] + [10**9]*H

for h in range(H):
  for damage, mp in magic:
    DP[min(h + damage, H)] = min(DP[min(h + damage, H)], DP[h] + mp)
print(DP[H])

### FIXED CODE ###

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

magic = [tuple(map(int, input().split())) for _ in range(N)]

DP = [0] + [10**9]*H

for h in range(H):
  for damage, mp in magic:
    DP[min(h + damage, H)] = min(DP[min(h + damage, H)], DP[h] + mp)
print(DP[H])
### BUGGY CODE ###

a,b,k=map(int,input().split())
for i in range(k):
    if(a>=1):
        a-=1
    elif((a<=0)and(b>=1)):
        b-=1
print(str(a)+' '+str(b))


### FIXED CODE ###

a,b,k=map(int,input().split())
if a>k:
    a-=k
    k=0
else:
    k-=a
    a=0
b=max(0,b-k)
print(a,b)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15

def main():
    H,W,N = map(int,input().split())
    point = [tuple(map(int,input().split())) for _ in range(N)]
    searched = set()

    ans = [0] * 10
    tot = 0
    for p,q in point:
        neighbor = [[0]*5 for _ in range(5)]
        for dy in (-2,-1,0,1,2):
            for dx in (-2,-1,0,1,2):
                if (p + dy,q + dx) in point:
                    neighbor[dy + 2][dx + 2] = 1
        
        for i in range(1,4):
            for j in range(1,4):
                if p + i - 2 <= 1 or p + i - 2 >= H:
                    continue
                if q + j - 2 <= 1 or q + j - 2 >= W:
                    continue
                if (p + i - 2,q + j - 2) in searched:
                    continue
                searched.add((p + i - 2,q + j - 2))
                cnt = 0
                for dy in (-1,0,1):
                    for dx in (-1,0,1):
                        if neighbor[i + dy][j + dx]:
                            cnt += 1
                tot += 1
                ans[cnt] += 1
    ans[0] = (H - 2)*(W - 2) - tot
    print('\n'.join(map(str,ans)))
if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15

from collections import deque,defaultdict,Counter
def main():
    H,W,N = map(int,input().split())
    point = [tuple(map(int,input().split())) for _ in range(N)]
    ans = [0] * 10

    dic = defaultdict(int)
    for p,q in point:
        for dy in (-1,0,1):
            for dx in (-1,0,1):
                if p + dy <= 1 or p + dy >= H:
                    continue
                if q + dx <= 1 or q + dx >= W:
                    continue
                center = (p + dy,q + dx)
                ans[dic[center]] -= 1
                dic[center] += 1
                ans[dic[center]] += 1
    ans[0] += (H - 2)*(W - 2)
    print('\n'.join(map(str,ans)))
if __name__ == '__main__':
    main()
### BUGGY CODE ###

N, S = map(int, input().split())
As = list(map(int, input().split()))
mod = 998244353
import numpy as np
dp = np.array([[2**i%mod]+[0]*(S) for i in range(N+1)])

for i in range(1, N+1):
    a = As[i-1]
    for s in range(1, S+1):
        if s-a>=0:
            dp[i][s] += (dp[i-1][s-a] + dp[i-1][s]*2)
        else:
            dp[i][s] += (dp[i-1][s]*2)
    dp[i] %= mod
print(dp[-1][-1]%mod)

### FIXED CODE ###

N, S = map(int, input().split())
As = list(map(int, input().split()))
mod = 998244353
dp = [[0]*(S+1) for i in range(N+1)]
dp[0][0] = 1
for i in range(1, N+1):
    a = As[i-1]
    for s in range(S+1):
        if s-a>=0:
            dp[i][s] += dp[i-1][s-a] + dp[i-1][s]*2
        else:
            dp[i][s] += dp[i-1][s]*2
        dp[i][s] %= mod
print(dp[-1][-1]%mod)
### BUGGY CODE ###

import math


temp = 0
K = int(input())
sum = 0
for A in range(1,K+1):
    for B in range(1,K+1):
        for C in range(1,K+1):
            if ((A == B) and (A == C)):
                sum = sum + A
            elif((B == C) and ( A != C)):
                temp = math.gcd(A,B)
                sum = sum + (3 * math.gcd(temp,C))
            elif(((A == B) and (A != C)) or ((A == C) and (A != B))):
                sum = sum + 0
            else:
                temp = math.gcd(A,B)
                sum = sum + math.gcd(temp,C)
print(sum)



### FIXED CODE ###

import math


temp = 0
K = int(input())
sum = 0
for A in range(1,K+1):
    for B in range(1,K+1):
        temp = math.gcd(A,B)
        for C in range(1,K+1):
            sum = sum + math.gcd(temp,C)
print(sum)
### BUGGY CODE ###

n = int(input())
x = list(map(int, input().split()))
ans = x[0]
for i in range(1,n):
	if 0 in x:
		ans = 0
		break
	ans = ans * x[i]
	if ans > 10 ** 18:
		ans = -1
		break
print(ans)

### FIXED CODE ###

n = int(input())
x = list(map(int, input().split()))
ans = x[0]
if 0 in x:
	ans = 0
else:
	for i in range(1,n):
		ans = ans * x[i]
		if ans > 10 ** 18:
			ans = -1
			break
print(ans)
### BUGGY CODE ###

import sys
input = sys.stdin.readline

def main():
  n, W = map(int, input().split())
  dp = [0]*(W+1)
  for _ in range(n):
    w, v = map(int, input().split())
    for j in range(W, w-1, -1):
      dp[j] = max(dp[j-w] + v, dp[j])
  print(dp[W])
  
if __name__ == "__main__":
  main()

### FIXED CODE ###

n, w = map(int, input().split())
l = [ list(map(int, input().split())) for _ in range(n) ]
dp = [ [0]*(w+1) for _ in range(n+1) ]
for i in range(1, n+1):
  for j in range(w+1):
    if j < l[i-1][0]:
      dp[i][j] = dp[i-1][j]
    else:
      dp[i][j] = max(dp[i-1][j-l[i-1][0]] + l[i-1][1], dp[i-1][j])
print(dp[n][w])
### BUGGY CODE ###

import sys
input = sys.stdin.readline
n= int(input())
s = str(input())
ans = 0
for i in range(n-2):
    for j in range(i+1, n-1):
        for k in range (j+1,n):
            t = {s[i], s[j], s[k]}
            if j-i != k-j and len(t) ==3:
                ans +=1
print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline
def main():
    n= int(input())
    s = str(input().rstrip())
    r= s.count('R')
    g=s.count('G')
    b = s.count('B')
    ans = 0
    for i in range(n-2):
        for j in range(i+1, (n+i+1)//2):
            k = 2*j-i
            t = {s[i], s[j], s[k]}
            if len(t) ==3:
                ans +=1
    print(r*g*b-ans)
if __name__ == '__main__':
    main()
### BUGGY CODE ###

#import collections
#aa = collections.Counter(a) # list to list
from itertools import combinations # (string,3) 3回


mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    n = int(input())
    S = []
    for i in range(n):
        s = input()
        S.append(s)
    na = ['M','A','R','C','H']
    cnt = 0
    for a,b,c in combinations(S,3):
        if a[0] in na and b[0] in na and c[0] in na and a[0]!=b[0] and b[0]!=c[0] and c[0]!= a[0]:
            cnt += 1
    print(cnt)



if __name__ == '__main__':
  main()


### FIXED CODE ###

#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
#from itertools import combinations # (string,3) 3回
#from collections import deque
#import collections.defaultdict(list)
#import bisect
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    # 選ぶ3人の頭文字がどうなっているかというと、'M','A','R'や、'A','C','H'のように、
    # 'MARCH'の中から選べる"異なる"3文字となっている
    # たとえば頭文字'M','A','R' に絞って考えると、 それぞれの文字で始まる人が、
    # 5,9,4人だった場合、組み合わせの数は 5 * 9 * 4 = 180 となる
    # これをすべて異なる3文字の組み合わせで調べ上げて、足し合わす。
    # ただし、各頭文字で始まる人がいなかった場合に、Keyerrorに注意

    # Python では ある頭文字で始まる人が何人いるかは、
    # collections.Counterを使って数え上げられる。
    # また、5個の中から異なる3個を取る組み合わせの列挙は、
    # itertools.combinationsを使える
    from collections import Counter
    from itertools import combinations

    n = int(input())
    l = [input()[0] for _ in range(n)]
    lc = Counter(l) # これで数えれる
    #print(lc)
    #     5
    # MASHIKE
    # RUMOI
    # OBIRA
    # HABORO
    # HOROKANAI
    # Counter({'H': 2, 'M': 1, 'R': 1, 'O': 1})

    con = []
    for c in 'MARCH': # ここ文字列でもいけるんだ
        if c in lc:
            con.append(lc[c]) # 辞書登録してるね。
            # ここで、conリスト　に 頭文字の個数を入れる。
    ans = 0
    for a,b,c in combinations(con,3): # conリストにある全通りの組み合わせを試す。
        ans += a * b * c
    print(ans)

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

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

history = []

index = 0
cnt = 0
loop_start_city_index = 0
for i in range(k+1):
    if i == k:
        print(index+1)
        exit()

    if index in history:    # すでに訪れた街にきた
        loop_start_city_index = index
        break
    history.append(index)
    index = a[index] - 1
    cnt += 1

from_start_to_loop_start = history.index(loop_start_city_index)
loop_length = len(history) - from_start_to_loop_start

print(history[from_start_to_loop_start + (k-from_start_to_loop_start)%loop_length] + 1)

### FIXED CODE ###

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

history = []
is_visited = [False] * n

index = 0
cnt = 0
loop_start_city_index = 0
for i in range(k+1):
    if i == k:
        print(index+1)
        exit()

    if is_visited[index]:    # すでに訪れた街にきた
        loop_start_city_index = index
        break
    
    is_visited[index] = True
    history.append(index)
    index = a[index] - 1
    cnt += 1

from_start_to_loop_start = history.index(loop_start_city_index)
loop_length = len(history) - from_start_to_loop_start

print(history[from_start_to_loop_start + (k-from_start_to_loop_start)%loop_length] + 1)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
"""
Created on Fri Jun 16 18:45:04 2017

@author: syaga
"""

if __name__ == "__main__":
    n = int(input())
    a = []
    for i in range(n):
        a.append(int(input()))
    max = a[1] - a[0]
    for i in range(1, len(a)):
        for j in range(0, i):
            diff = a[i] - a[j]
            if diff > max:
                max = diff
    print(max)

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Fri Jun 16 18:45:04 2017

@author: syaga
"""

if __name__ == "__main__":
    n = int(input())
    a = []
    for i in range(n):
        a.append(int(input()))
    max = a[1] - a[0]
    mini = a[0]
    for i in range(1, len(a)):
        diff = a[i] - mini
        if diff > max:
            max = diff
        if mini > a[i]:
            mini = a[i]
    print(max)
### BUGGY CODE ###

import math
A, B, N = (int(i) for i in input().split())  
ans = 0
for x in range(N+1):
  ans = max(ans, math.floor(A * x / B) - A * math.floor(x/B))
    
print(ans)



### FIXED CODE ###

import math
A, B, N = (int(i) for i in input().split())  

def func(A, B, x):
  return math.floor(A * x / B) - A * math.floor(x/B)

print(func(A, B, min(N, B-1)))
### BUGGY CODE ###

x=int(input())
a=int(x**(1/5))+1
l=list(range(a+1))
s=[]
m=0
n=0
w=0
e=1
r=1
for i in l:
  k=i**5
  l[i]=k
for i in l:
  s.append(i*-1)
p=l+s
for i in p:
  if m==1:
    break
  for q in p:
    if x==i-q:
      print(int(i**(1/5)),end=" ")
      m+=1
      if p.index(q)<=a+1:
        print(p.index(q))
      else:
        print((p.index(q)-a-1)*-1)
      break
if m==0:
  while  n==0:
    u=e**5-w**5
    if u>x:
      w==0
      r+=1
      e=r
    if x==u:
      print(e,end=" ")
      print(w)
      n+=1
    else:
      e+=1
      w+=1

### FIXED CODE ###

x=int(input())
m=0
for i in range(500):
  for k in range(500):
    w=i**5
    e=k**5
    r=k**5*-1
    if w-e==x:
      print(i,end=" ")
      print(k)
      m+=1
      break
    elif w-r==x:
      print(i,end=" ")
      print(k*-1)
      m+=1
      break
  if m==1:
    break
### BUGGY CODE ###

from sys import stdin
import math
import fractions
from collections import deque
from collections import Counter
import itertools

INF = 10 ** 10

N, K  = [int(x) for x in stdin.readline().rstrip().split()]
A = [0] + [int(x) for x in stdin.readline().rstrip().split()]

stack = [1]
nextt = A[1]

while True:
    if not nextt in stack:
        stack.append(nextt)
    else:
        stack.append(nextt)
        break
    nextt = A[nextt]

    if len(stack) > K:
        print(stack[K])
        exit()

num1 = stack.pop()
length = len(stack)
tmp = []
while True:
    num2 = stack.pop()
    if num1 != num2:
        tmp.append(num2)
    else:
        tmp.append(num2)
        break

tmp = tmp[::-1]

index = (K - length) % len(tmp)

print(tmp[index])
    


### FIXED CODE ###

from sys import stdin
import math
import fractions
from collections import deque
from collections import Counter
import itertools

INF = 10 ** 10

N, K  = [int(x) for x in stdin.readline().rstrip().split()]
A = [0] + [int(x) for x in stdin.readline().rstrip().split()]

stack = [1]
nextt = A[1]
visited_dict = {1: True}

while True:
    if not visited_dict.get(nextt, False):
        stack.append(nextt)
        visited_dict[nextt] = True
    else:
        stack.append(nextt)
        break
    nextt = A[nextt]

    if len(stack) > K:
        print(stack[K])
        exit()

num1 = stack.pop()
length = len(stack)
tmp = []
while True:
    num2 = stack.pop()
    if num1 != num2:
        tmp.append(num2)
    else:
        tmp.append(num2)
        break

tmp = tmp[::-1]

index = (K - length) % len(tmp)

print(tmp[index])
### BUGGY CODE ###

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

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

if is_prime(M) == True:
    if M/N == 1:
        print(N)
    else:
        print(1)
else:
    for i in range(int(M/N),0,-1):
        if M % i ==0:
            print(i)
            break

### FIXED CODE ###

N,M= map(int, input().split())
yakusu =[]

for i in range(int(M**(1/2)),0,-1):
    if M % i == 0:
        yakusu.append(i)
        yakusu.append(int(M/i))

yakusu.sort(reverse=True)

for i in yakusu:
    if i <= M/N:
        print(i)
        break
### BUGGY CODE ###

import sys
input = sys.stdin.readline

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

    while max(a) - min(a) > 0:
        a.sort()
        a[-1] = a[-1]%a[0]
        if a[-1] == 0:
            del a[-1]

    print(min(a))

main()

### FIXED CODE ###

import sys
import fractions
input = sys.stdin.readline

def main():
    n = int(input())
    a = list(map(int, input().split()))
    g = a[0]

    for i in range(1, n):
        g = fractions.gcd(g, a[i])
    
    print(g)

main()
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))
# L = [(i, i + v, v - i) for i, v in enumerate(A)]
Ai = dict()
Aj = dict()
for i, v in enumerate(A):
    ans = 0
    ai = i + v
    aj = i - v
    if ai in Ai:
        Ai[ai].append(i)
    else:
        Ai[ai] = [i]
    if aj in Aj:
        Aj[aj].append(i)
    else:
        Aj[aj] = [i]
ans = 0
intersection_keys = Ai.keys() & Aj.keys()
for key in intersection_keys:
    Ai_list = Ai[key]
    Aj_list = Aj[key]
    for i in Ai_list:
        ans += len([j for j in Aj_list if j > i])

print(ans)

### FIXED CODE ###

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

Ai = dict()
ans = 0
for i, v in enumerate(A):
    ai = i + v
    if ai in Ai:
        Ai[ai].append(i)
    else:
        Ai[ai] = [i]
for i, v in enumerate(A):
    aj = i - v
    if aj in Ai:
        ans += len(Ai[aj])
print(ans)
### BUGGY CODE ###

K = int(input())

if K % 2 == 0 or K % 5 == 0:
  print(-1)
else:
  if K % 7 == 0:
    L = 9 * K // 7
  else:
    L = 9 * K
  a = 10 % L
  check = False
  for i in range(L):
    if a % L == 1:
      print(i + 1)
      check = True
      break
    a *= 10
  if not check:
    print(-1)

### FIXED CODE ###

K = int(input())

if K % 2 == 0 or K % 5 == 0:
  print(-1)
else:
  if K % 7 == 0:
    L = 9 * K // 7
  else:
    L = 9 * K
  a = 10 % L
  check = False
  for i in range(L):
    a %= L
    if a == 1:
      print(i + 1)
      check = True
      break
    a *= 10
  if not check:
    print(-1)
### BUGGY CODE ###

a=int(input())
list1=[0]*(a-1)
list1=list(map(int,input().split()))
for i in range(a):
    print(list1.count(i+1))

### FIXED CODE ###

import collections
 
n= int(input())
a= list(map(int, input().split()))
cnt = collections.Counter(a)
for i in range(1, n+1):
    print(cnt[i])