CodeEff/ECCO huggingface dataset:
# Original solution
N = int(input())
A = list(map(int,input().split()))
print(*[A.count(n+1) for n in range(N)],sep="\n")


# Optimized solution
N = int(input())
A = list(map(int,input().split()))
B = N*[0]

for a in A:
  B[a-1]+=1

print(*B,sep="\n")
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))

for i in range(1, n+1):
    print((a.count(i)))

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
ans = [0] * n

for i in a:
    ans[i-1] += 1
for i in ans:
    print(i)
# Original solution
N = int(eval(input()))
A = list(map(int,input().split()))
c = 0
i = 0
for i in range(N):
  if c < N:
    b = A.count(i + 1)
    print(b)
    c += b
  else:
    print(o)

# Optimized solution
n = int(eval(input()))
A = list(map(int,input().split()))
L = [0] * n
for i in A:
    L[i - 1] += 1
for j in L:
    print(j)
# Original solution
from collections import deque
N = int(eval(input()))
A = [int(n) for n in input().split()]
d = deque(A)
for i in range(1, N+1):
    print((d.count(i)))


# Optimized solution
from sys import stdin
N = int(eval(input()))
A = [0]*2 + [int(n) for n in stdin.readline().split()]
ans = [0]+[0]*N
for i in range(2, N+1):
    ans[A[i]] += 1
for i in range(1, N+1):
    print((ans[i]))
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))

for i in range(1,n+1):
  cnt = 0
  for ai in a:
    if ai == i:
      cnt += 1
  print(cnt)

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))

d = {}
for i in range(0,n-1):
  if a[i] in d:
    d[a[i]] += 1
  else:
    d[a[i]] = 1
    
for i in range(1,n+1):
  if i in list(d.keys()):
    print((d[i]))
  else:
    print((0))
# Original solution
n = int(eval(input()))
A = list(map(int, input().split()))

for i in range(1, n+1):
    print((A.count(i)))


# Optimized solution
n = int(eval(input()))
A = list(map(int, input().split()))
B = [0]*n

for i in A:
    B[i-1] += 1

for i in B:
    print(i)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))

for i in range(n):
    print((a.count(i+1)))

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

arr = [0]*n
for i in a:
    arr[i-1] += 1

[print(i) for i in arr]
# Original solution
import collections

N = int(eval(input()))
A = list(map(int, input().split()))
ans = [0] * (N+1)
for i in range(len(A)):
  ans[A[i]] += 1
  
for i in range(1, N+1):
  print((ans[i]))

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))
ans = [0] * (N+1)
for i in range(len(A)):
  ans[A[i]] += 1
  
for i in range(1, N+1):
  print((ans[i]))
# Original solution
n=int(eval(input()))
a=list(map(str,input().split()))
s=[0]*n

for i in range(1,n):
  s[i-1]=a.count(str(i))
  
  print((s[i-1]))

print((0))

# Optimized solution
n=int(eval(input()))
a=list(map(int,input().split()))
s=[0]*n

for i in a:
  s[i-1]+=1

for i in s:
  print(i)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
b = [0]*n
for i in range(1, n+1):
    j = a.count(i)
    if j != 0:
        b[i-1] = j
for i in b:
    print(i)

# Optimized solution
n = int(eval(input()))
a = list(map(int,input().split()))
l = [0]*n
for i in range(n-1):
    j = a[i]
    l[j-1] += 1
for i in range(n):
    print((l[i]))
# Original solution
N = int(eval(input()))
Ai = list(map(int, input().split()))
Ai.insert(0, 0)
for i in range(1, N + 1 ,1):
    buka = Ai.count(i)
    print(buka)

# Optimized solution
N = int(eval(input()))
Az = [0 for i in range(N)]
Ai = list(map(int, input().split()))

for i in Ai:
    Az[i-1] += 1
for j in Az:
    print(j)
# Original solution
N = int(eval(input()))
A = list(map(int,input().split()))
for i in range(1,N+1):
    count = 0
    B =[]
    for j in range(len(A)):
        if A[j]==i:
            count += 1
        else:
            B.append(A[j])
    print(count)
    A = B

# Optimized solution
N = int(eval(input()))
A = list(map(int,input().split()))
B = [0]*N
for i in range (len(A)):
    B[A[i]-1] +=1
print(('\n'.join(map(str, B))))
# Original solution
N=int(eval(input()))
A=list(map(int,input().split()))
for i in range(1,max(A)+1):
  print((A.count(i)))
for j in range(max(A)+1,N+1):
  print((0))

# Optimized solution
N = int(eval(input()))
A = list(map(int,input().split()))
c=[]
for i in range (N):
  c.append(0)
for j in A:
  c[j-1]+=1

for C in c:
  print(C)
# Original solution
N = int(eval(input()))
A = list( map( int, input().split() ) )

for i in range(1, N+1):
  print(( A.count(i) ))

# Optimized solution
N = int(eval(input()))
A = list( map( int, input().split() ) )
 
ans = [ 0 for i in range(N) ]

for i in A:
  ans[i-1] += 1

for i in ans:
  print(i)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
for i in range(1, n+1):
  print((a.count(i)))

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
l = [0] * n
for i in range(n-1):
    l[a[i]-1] += 1
for i in range(n):
    print((l[i]))
# Original solution
n = int(eval(input()))
a = input().split()

joshi = {}

for i in range(1, n+1):
    joshi[str(i)] = 0

for i in range(n-1):
    joshi[a[i]] += 1

for key in list(joshi.keys()):
    print((joshi[key]))

# Optimized solution
n = int(eval(input()))
a = input().split()
 
joshi = {}
 
for i in range(1, n+1):
    joshi[str(i)] = 0
 
for i in range(n-1):
    joshi[a[i]] += 1
 
for ans in list(joshi.values()):
    print(ans)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
list= [0]*n

for i in a:
    list[i-1] += 1

for j in list:
    print(j)

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))

li = [0]*n

for i in a:
    li[i-1] += 1

#print(li)

for j in li:
    print(j)
# Original solution
a = int(eval(input()))
b = list(map(int, input().split()))
b.sort()
l = 0
for i in range(1,a+1):
     l = len(b)
     b = [j for j in b if j != i]
     print((l-len(b)))

# Optimized solution
def main():
    a = int(eval(input()))
    b = list(map(int, input().split()))
    c = [0]*a
    for i in b:
        c[i-1] += 1
    for j in c:
        print(j)
if __name__ == '__main__':
    main()
# Original solution
N = int(eval(input()))
emp = list(map(int,input().split()))
emp.sort()
# def rem_val(arr, value):
#     while value in arr:
#         try:
#             arr.remove(value)
#         except:
#             break
for i in range(N):
    # if(len(emp)!=0):
    print((emp.count(i+1)))
        # rem_val(emp,i+1)
    # else:
    #     print(0)


# Optimized solution
N = int(eval(input()))
emp = list(map(int,input().split()))
ans_l = [0]*(N+1)
for i in range(N-1):
    a = emp[i]
    ans_l[a] +=1
for i in range(1,N+1):
    print((ans_l[i]))
# Original solution
N = int(eval(input()))
sum = 0
array = list(map(int,input().split()))
for i in range(1,N):
    print((array.count(i)))
    sum += array.count(i)
print((0))


# Optimized solution
N = int(eval(input()))
sum = 0
now = 1
for i in sorted(list(map(int,input().split()))):
    if(now == i):
        sum += 1
    else:
        print(sum)
        for j in range(i-now-1):
            print((0))
        now = i
        sum = 1
else:
    print(sum)
while(now < N):
    now += 1
    print((0))
# Original solution
n = int(eval(input()))
a = {}
for i in range(1, n+1):
    a[i] = []

member = list(map(int, input().split()))
for i in member:
    a[i].append(1)

for j in a:
    print((len(a[j])))

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

member = [0] * n
for i in a:
    member[i-1] += 1

print(*member, sep='\n')
# Original solution
from collections import Counter

def resolve():
  N = int(eval(input()))
  A = [int(x) for x in input().split(" ")]
  collection = Counter(A)
  for i in range(1, N + 1):
    print((collection[i]))
  # results = [str(A.count(i))+'\n' for i in range(1, N+1)]
  # print('\n'.join(results))

if __name__ == "__main__":
  resolve()

# Optimized solution
def resolve():
  N = int(eval(input()))
  A = [int(x) for x in input().split(" ")]
  results = [0] * N
  for a in A:
    results[a-1] += 1
  for r in results:
    print(r)

if __name__ == "__main__":
  resolve()
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))

for i in range(n-1):
    print((a.count(i+1)))
print((0))

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
anss = [0] * n
for _ in a:
    anss[_-1] += 1
for ans in anss:
    print(ans)
# Original solution
N = int(eval(input()))
A = list(map(int,input().split()))

for i in range(N):
    print((A.count(i+1)))

# Optimized solution
N = int(eval(input()))
A = list(map(int,input().split()))

sorted(A)
ans = [0] * N

for j in range(N-1):
    i = A[j] - 1
    ans[i] += 1

for i in range(N):
    print((ans[i]))
# Original solution
N = int(eval(input()))
a = list(map(int,input().split()))

for i in range(N):
    print((a.count(i+1)))

# Optimized solution
N = int(eval(input()))
a = list(map(int,input().split()))
b = [0]*N
for i in a:
    b[i-1] += 1
for i in b:
    print(i)
# Original solution
N = int(eval(input()))
A = list(map(int,input().split()))

I = [0]*N

for i in range(N):
    for j in range(len(A)):
        if A[j] == i:
            I[i-1] += 1


for i in range(N):
    print((I[i]))


# Optimized solution
N = int(eval(input()))
A = list(map(int,input().split()))

I = [0]*N

for i in range(len(A)):
    I[A[i] - 1 ] += 1


for i in range(N):
    print((I[i]))
# Original solution
n = int(eval(input()))

a = []
s = [0] * n
a.append(input().split())

for i in range(n - 1):
    a[0][i] = int(a[0][i])
    for j in range(a[0][i]+1):
        if j == a[0][i]:
            s[j - 1] += 1
            break

for i in range(n):
    print((s[i]))

# Optimized solution
n = int(eval(input()))

a = []
s = [0] * n
a.append(input().split())

for i in range(n - 1):
    a[0][i] = int(a[0][i])
    s[a[0][i]-1] += 1

for i in range(n):
    print((s[i]))
# Original solution
n = int(eval(input()))

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

for i in range(1,n+1):
    print((a.count(i)))

# Optimized solution
n = int(eval(input()))

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

a.sort()

tmp=0
cnt=0

for bangou in range(1,n+1):
    if tmp<len(a):
        while a[tmp]==bangou:
            cnt+=1
            tmp+=1
            if tmp==len(a):
                break
    print(cnt)
    cnt=0
# Original solution
N = int(eval(input()))
a = [int(x) for x in input().split()]
L = len(a)
for i in range(1,N+1):
    answer = 0
    for j in range(L):
        if i == a[j]:
            answer += 1
    print(answer)

# Optimized solution
N = int(eval(input()))
a = [int(x) for x in input().split()]
answer = [0] * N
for i in range(1,N):
    x = a[i-1]
    answer[x-1] +=1

for i in range(N):
    print((answer[i]))
# Original solution
# In peace, in love, in war, everything is the same

import math

deg = [0] * 200005
n=int(eval(input()))
ar = list(map(int, input().split()))

for i in range(n-1):
    deg[ar[i]] = deg[ar[i]] + 1

for i in range(1, n+1, 1):
    print((deg[i]))

# Optimized solution
if __name__ == "__main__":
    tcase = int(eval(input()))
    pcase = [ int(i) for  i in input().split(' ')]
    leng = len(pcase) + 1
    items = [0]*leng
    for i in pcase:
        items[i-1] +=1
    for i in items:
        print(i)
# Original solution
import sys
N = int(sys.stdin.readline())
li = list(map(int, sys.stdin.readline().split()))
i = 1
while i <= N:
  print((li.count(i)))
  i += 1

# Optimized solution
import sys
N = int(sys.stdin.readline())
li = list(map(int, sys.stdin.readline().split()))
li1 = [0]*N
for i in li:
  li1[i-1] += 1
for i in li1:
  print(i)
# Original solution
N = int(eval(input()))
P = list(map(int, input().split()))

list = []
for i in range(0, N + 1):
    list.append(0)
for i in range(0, N - 1):
    a = P[i]
    list[a] += 1
for i in range(1, N + 1):
    print((list[i]))


# Optimized solution
N = int(eval(input()))
P = list(map(int, input().split()))

list = [0] * (N + 1)
for i in range(0, N - 1):
    a = P[i]
    list[a] += 1
for i in range(1, N + 1):
    print((list[i]))
# Original solution
import itertools
N=int(eval(input()))
listA=list(map(int,input().split()))
listA.sort()
listA2=[0]*N
for i in listA:
  listA2[i-1]+=1
for i in range(1,N+1):
  if i in listA:
    print((listA2[i-1]))
  else:
    print((0))

# Optimized solution
import itertools
N=int(eval(input()))
listA=list(map(int,input().split()))
listA.sort()
listA2=[0]*N
for i in listA:
  listA2[i-1]+=1
listA=set(listA)  
for i in range(1,N+1):
  if i in listA:
    print((listA2[i-1]))
  else:
    print((0))
# Original solution
EN = input().split()
Bc = [0] * int(EN[0])

tmp = input().split()

for i in tmp:
    BossN = int(i)
    Bc[BossN-1] = Bc[BossN-1] + 1

print(*Bc,sep='\n')


# Optimized solution
EN = input().split()
Bc = [0] * int(EN[0])

tmp = input().split()
BossN = [int(s) for s in tmp]

for i in BossN:

    Bc[i-1] = Bc[i-1] + 1

print(*Bc,sep='\n')
# Original solution
n = eval(input())
a = input().split()

for i in range( int(n) ):
    print(( a.count(str(i+1)) ))

# Optimized solution
n = eval(input())
a = input().split()
out = [0] * int(n)

#for i in range( int(n) ):
#    print( a.count(str(i+1)) )

for a_i in a:
    a_i = int(a_i)
    out[a_i-1] += 1

for out_i in out:
    print( out_i )
# Original solution
n = int(eval(input()))
list_ = list(map(int, input().split()))

for i in range(1,n+1):
  print((list_.count(i)))

# Optimized solution
n = int(eval(input()))

list_ = [0]*n
joshi_list = list(map(int, input().split()))[::-1]

for i,num in enumerate(joshi_list):
  list_[num-1]+=1

for num in list_:
  print(num)
# Original solution
i = int(eval(input()))
ii = list(map(int,input().split()))

import collections

c = collections.Counter(ii)
k = list(c.keys())

for a in range(i):
    if k.count(a+1)==0:
        print((0))
    else:
        print((c[a+1]))

# Optimized solution
i = int(eval(input()))
ii = list(map(int,input().split()))

import collections

c = collections.Counter(ii)
k = list(c.keys())

for a in range(1,i+1):
    print((c[a]))
# Original solution
import collections
N=int(eval(input()))
A=[int(s) for s in input().split(" ")]

for i in range(1,N+1):
    count=A.count(i)
    print(count)

# Optimized solution
n = int(eval(input()))
A = list(map(int,input().split()))

List = [0] * (n)
for i in range(n-1):
    List[A[i]-1] += 1

for i in List:
    print(i)
# Original solution
N=int(eval(input()))
A=list(map(int,input().split()))
for i in range(1,N+1):
    print((A.count(i)))

# Optimized solution
N=int(eval(input()))
A=list(map(int,input().split()))
ans=[0]*N
for i in range(N-1):
    ans[A[i]-1]+=1
for i in range(N):
    print((ans[i]))
# Original solution
N = int(eval(input()))
A = sorted(list(map(int, input().split())))

for n in range(N):
    print((A.count(n+1)))


# Optimized solution
N = int(eval(input()))
A = sorted(list(map(int, input().split())))

#for n in range(N):
#    print(A.count(n+1))

M = {}
for a in A:
    M[a] = M.get(a,0) + 1

for n in range(N):
    print((M.get(n+1,0)))
# Original solution
n=int(eval(input()))
a=list(map(int,input().split()))
for i in range(n):
  print((a.count(i+1)))

# Optimized solution
n=int(eval(input()))
a=list(map(int,input().split()))
c=[0 for _ in range(n)]
for i in range(len(a)):
  c[a[i]-1]+=1
for j in range(len(c)):
  print((c[j]))
# Original solution
n = int(eval(input()))
a = list(map(int,input().split()))

for i in range(n):
    b = a.count(i+1)
    print(b)
    del a[:b]
    


# Optimized solution
n = int(eval(input()))
A = list(map(int,input().split()))

lis = [0] * n
for i in A:
  lis[i-1] += 1

for j in range(len(lis)):
  print((lis[j]))
# Original solution
N = int(eval(input()))
A = list(map(int, input().strip().split(' ')))

ans = [0]

for i in range(N - 1):
    ans = ans + [0]

for i in range(N - 1):
    ans[A[i] - 1] = ans[A[i] - 1] + 1

for i in range(N):
    print((ans[i]))

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().strip().split(' ')))

ans = [0] * N

for i in range(N - 1):
    ans[A[i] - 1] = ans[A[i] - 1] + 1

for i in range(N):
    print((ans[i]))
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))

for i in range(1,n+1):
  print((a.count(i)))

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
ans = [0]*n
for i in a:
  ans[i-1] += 1
for i in ans:
  print(i)
# Original solution
import math
N = int(eval(input()))
a = list(map(int,input().split()))
for i in range(1,N+1):
    print((a.count(i)))

# Optimized solution
import math
N = int(eval(input()))
a = list(map(int,input().split()))
c = [0]*(N+1)
for i in range(N-1):
    b = a[i]
    c[b] += 1
for j in range(1,N+1):
    print((c[j]))
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))

for i in range(n):
    print((len([j for j in a if j == i + 1])))

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))

lis = [0] * n
for i in a:
    lis[i-1] += 1
for i in lis:
    print(i)
# Original solution
N = int(eval(input()))
A = list(map(int,input().split()))
sub = [0]*N
for i in range(N):
  sub[i] = A.count(i+1)
for j in range(N):
  print((sub[j]))

# Optimized solution
N = int(eval(input()))
A = list(map(int,input().split()))
B = {}
for i in A:
  if i not in B:
    B[i] = 0
  B[i] += 1
  
for j in range(1,N+1):
  try:
    print((B[j]))
  except KeyError:
    print((0))
# Original solution
from collections import Counter

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

for i in range(1,N+1):
    print((Counter(A)[i]))


# Optimized solution
from collections import defaultdict
N = int(eval(input()))
A = list(map(int,input().split()))

d = defaultdict(int)

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

for i in range(1,N+1):
    print((d[i]))
# Original solution
def main():
	s = int(eval(input()))
	a = list(map(str,input().split()))

	for i in range(1,s+1):
		print((a.count(str(i))))
	

if __name__ == '__main__':
	main()

# Optimized solution
def main():
	s = int(eval(input()))
	a = list(map(int,input().split()))
	l = [0] * s
	for i in range(s-1):
		l[a[i-1]-1] += 1
	print(('\n'.join(map(str,l))))
	

if __name__ == '__main__':
	main()
# Original solution
n=int(input())
a=list(map(int,input().split()))
ans=[0]*n
for i in range(1,n+1):
    ans[i-1]=a.count(i)
print(*ans,sep="\n")



# Optimized solution
n=int(eval(input()))
a=list(map(int,input().split()))
ans=[0]*n
for i in a:
    ans[i-1]+=1
for k in ans:
    print(k)
# Original solution
n=int(eval(input()))
a=list(map(int,input().split()))
ans=[0]*n
for i in a:
    ans[i-1]+=1
for k in ans:
    print(k)



# Optimized solution
n=int(input())
a=list(map(int,input().split()))
ans=[0]*n
for i in a:
    ans[i-1]+=1
print(*ans,sep="\n")
# Original solution
n= int(eval(input()))

list= list(map(int, input().split()))
cnt=0

for i in range(n):
	if cnt<n:	
		listi=list[cnt:]	
		a=listi.count(i+1)
		cnt+=a
		print(a)
	else:
		print((0))

# Optimized solution
n = int(eval(input()))
lis = list(map(int, input().split()))
cnt = [0]*(n)

for i in range(n-1):
	cnt[lis[i]-1]+=1

for i in range(n):
	print((cnt[i]))
# Original solution
from collections import Counter


n = int(eval(input()))
A = Counter(list(map(int, input().split())))
for i in range(1, n + 1):
    print((A.get(i, 0)))


# Optimized solution
n = int(input())
A = list(map(int, input().split()))
ans = [0] * n
for i in A:
    ans[i - 1] += 1
[print(i) for i in ans]
# Original solution
n = int(input())
A = list(map(int, input().split()))
ans = [0] * n
for i in A:
    ans[i - 1] += 1
[print(i) for i in ans]


# Optimized solution
n = int(input())
A = map(int, input().split())
ans = [0] * n
for i in A:
    ans[i - 1] += 1
[print(i) for i in ans]
# Original solution
N=int(eval(input()))
A=list(map(int,input().split()))
for i in range(1,N+1):
    print((A.count(i)))

# Optimized solution
N=int(eval(input()))
A=list(map(int,input().split()))
ans=[0]*N
for i in A:
    ans[i-1]+=1
for j in ans:
    print(j)
# Original solution
N = int(eval(input()))
bosses = list(map(int, input().split()))

subordinates = [0] * (N + 1)
for boss in bosses:
  subordinates[boss] += 1
  
for count in subordinates[1:]:
  print(count)

# Optimized solution
N = int(eval(input()))
bosses = list(map(int, input().split()))

subordinates = [0] * (N + 1)
for boss in bosses:
  subordinates[boss] += 1

print(("\n".join(map(str, subordinates[1:]))))
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))

for n in range(N):
  print((A.count(n+1)))

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))

man=1
cnt=0
man_list=[0]*N
A.sort()
A += [0]

for a in A:
  if a != man:
    man_list[man-1] = cnt
    man = a
    cnt=0
  cnt+=1

for l in man_list:
  print(l)
# Original solution
import collections

def main(A):
    return collections.Counter(A)


if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))
    # N = 7
    # A = list(map(int, "1 2 3 4 5 6".split()))
    [print(main(A)[i + 1]) for i in range(N)]


# Optimized solution
import collections

def main(N, A):
    c = collections.Counter(A)
    [print(c[i+1]) for i in range(max(c.keys()))]
    [print(0) for i in range(max(c.keys()), N)]

if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))
    # N = 7
    # A = list(map(int, "1 2 3 4 5 6".split()))
    main(N, A)
# Original solution
N = int(eval(input()))
A = list(map(int,input().split()))

for i in range(1,N+1):
    print((A.count(i)))


# Optimized solution
N = int(eval(input()))
A = list(map(int,input().split()))

ans = [0] * N

for i in range(N-1):
    ans[A[i] -1] += 1

for i in range(N):
    print((ans[i]))
# Original solution
from collections import Counter
n=int(eval(input()))
A=list(map(int,input().split()))
AC=Counter(A)
for i in range(n):
    if (i+1) in list(AC.keys()):
        print((AC[i+1]))
    else:
        print((0))

# Optimized solution
n=int(eval(input()))
A=list(map(int,input().split()))
L=[0]*n
for i in range(n-1):
    L[A[i]-1]+=1
for i in range(n):
    print((L[i]))
# Original solution
n = int(eval(input()))

p = list(map(int,input().split()))

for x in range(1,n+1):
  print((p.count(x)))
  


# Optimized solution
n = int(eval(input()))
p = list(map(int,input().split()))

p2 = [0]*n 

for x in p:
    p2[x-1] = p2[x-1] + 1

for x in p2:
    print(x)
# Original solution
n=int(eval(input()))
as_=list(map(int,input().split()))
for i in range(1,n):
    print((as_[i-1:].count(i)))
print((0))


# Optimized solution
n=int(eval(input()))
as_=list(map(int,input().split()))
l=[0 for _ in range(n)]
for a in as_:
    l[a-1]+=1
for c in l:
    print(c)
# Original solution
n = int(eval(input()))
c = input().split()

for i in range(1, n+1):
    print((c.count(str(i))))


# Optimized solution
n = int(eval(input()))
c = input().split()
c = [int(n) for n in c]

s = dict.fromkeys([int(n) for n in range(1,n+1)], 0)

for i in c:
    s[i] = s[i] + 1

for i in range(1, n+1):
    print((s[i]))
# Original solution
n=int(eval(input()))
a=list(map(int,input().split()))
for i in range(1,n+1):
    print((a.count(i)))

# Optimized solution
n=int(input())
a=list(map(int,input().split()))
b=[0]*n
for i in a:
    b[i-1]+=1
[print(i) for i in b]
# Original solution
i = int(eval(input()))
a = list(map(int, input().split()))

for j in range(len(a)):
    s = a.count(j+1)
    print(s)
print((0))

# Optimized solution
s = eval(input())

j = [0]*int(s)

a = list(map(int,input().split()))
for i in  range(int(s)-1):
    j[a[i]] += 1
for i in range(len(j)-1):
    print((j[(i+1)]))

print((0))
# Original solution
N=int(eval(input()))
A=list(map(int,input().split()))
for i in range(N):
  print((A.count(i+1)))

# Optimized solution
N=int(eval(input()))
A=list(map(int,input().split()))
T=[0 for i in range(N)]
for a in A:
  T[a-1]+=1
for t in T:
  print(t)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
for i in range(1, n + 1):
    print((a.count(i)))

# Optimized solution
n = int(input())
a = list(map(int, input().split()))
l = [0 for i in range(n)]
for i in a:
    l[i - 1] += 1
print(*l, sep="\n")
# Original solution
n=int(eval(input()))
a=list(map(int,input().split(" ")))
# print(n,a)
for j in range(1,n+1):
	a1=[i for i in a if i == j]
	print((len(a1)))

# Optimized solution
n=int(eval(input()))
a=list(map(int,input().split(" ")))
countlist=[0 for i in range(n)]
for j in range(n-1):
  countlist[a[j]-1]+=1
for i in range(n):
	print((countlist[i]))