Problem:
 Score : 300 points    Problem Statement A company has N members, who are assigned ID numbers 1, ..., N .  Every member, except the member numbered 1 , has exactly one immediate boss with a smaller ID number.  When a person X is the immediate boss of a person Y , the person Y is said to be an immediate subordinate of the person X .  You are given the information that the immediate boss of the member numbered i is the member numbered A_i . For each member, find how many immediate subordinates it has.      Constraints  2 \leq N \leq 2 \times 10^5  1 \leq A_i < i         Input Input is given from Standard Input in the following format:  N  A_2  ...  A_N       Output For each of the members numbered 1, 2, ..., N , print the number of immediate subordinates it has, in its own line.        Sample Input 1 5
1 1 2 2      Sample Output 1 2
2
0
0
0  The member numbered 1 has two immediate subordinates: the members numbered 2 and 3 .  The member numbered 2 has two immediate subordinates: the members numbered 4 and 5 .  The members numbered 3 , 4 , and 5 do not have immediate subordinates.       Sample Input 2 10
1 1 1 1 1 1 1 1 1      Sample Output 2 9
0
0
0
0
0
0
0
0
0       Sample Input 3 7
1 2 3 4 5 6      Sample Output 3 1
1
1
1
1
1
0

Solution (Python):
def examA():
    N = I()

    ans = 0
    print(ans)
    return

def examB():
    N, M = LI()
    A = LI()
    S = sum(A)
    if N>=S:
        ans = N-S
    else:
        ans = -1
    print(ans)
    return

def examC():
    N = I()
    A = LI()
    ans = [0]*N
    for i in range(N-2,-1,-1):
        ans[A[i]-1] +=1
    for v in ans:
        print(v)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(readline())
def LI(): return list(map(int,readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examC()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

Solution (Python):
from collections import Counter
n = int(input())
c = Counter(map(int, input().split()))
for i in range(1, n+1):
    print(c[i])

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
from collections import Counter
def main():
    n=int(input())
    A=[int(_) for _ in input().split()]
    AC=Counter(A)
    for i in range(n):
        print(AC[i+1])

if __name__=='__main__':
    main()

Solution (Python):
n,*a=map(int,open(0).read().split())
l=[0]*n
for x in a:
  l[x-1]+=1
print("\n".join(map(str,l)))

Solution (Python):
from collections import Counter
N = int(input())
A = [int(c) for c in input().split()]
c = Counter(A)
for i in range(1,N+1):
  print(c[i])

Solution (Python):
def main():
    n = int(input())
    a = list(map(int, input().split()))
    l = [0]*n
    for i in a:
        l[i-1] += 1
    for i in l:
        print(i)


main()

Solution (Python):
N = int(input())
arr = list(map(int, input().split(" ")))
ans = [0]*N
for a in arr :
    ans[a-1] += 1

for a in ans :
    print(a)

Solution (Python):
n = int(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)

Solution (Python):
n = int(input())
lis = list(map(int,input().split()))
num = [0 for i in range(n)]
for nn in lis:
    num[nn-1] += 1
for nn in num:
    print(nn)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
ans = [0]*(N+1)

for a in A:
    ans[a] += 1

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

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

Solution (Python):
n = int(input())
c = [0] * n
for x in list(map(int, input().split())):
    c[x - 1] += 1
for x in c:
    print(x)

Solution (Python):
import sys
input=lambda: sys.stdin.readline().rstrip()
n=int(input())
A=[int(i) for i in input().split()]
Ans=[0]*n
for a in A:
  Ans[a-1]+=1
for a in Ans:
  print(a)

Solution (Python):
N = int(input())
*A, = map(int,input().split())
ans = [0]*N
for a in A:
    a -=1
    ans[a] += 1
for out in ans:
    print(out)

Solution (Python):

from collections import Counter, deque,defaultdict
N =int(input())
A = list(map(int, input().split()))

d = defaultdict(int)
for i in range(len(A)):
    d[A[i]] += 1

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

Solution (Python):
N=int(input())
A=[0 for i in range(N)]
a=[int(i) for i in input().split(" ")]
for _a in a:
    A[_a-1]+=1

for a in A:
    print(a)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
num=[0]*n
for i in range(n-1):
	num[a[i]-1]+=1
for x in num:
	print(x)

Solution (Python):
from collections import Counter


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

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

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

d = defaultdict(int)
n = inp()
a = inpl()
for i in a:
    d[i] += 1
for i in range(n):
    print(d[i+1])

Solution (Python):


import sys
sys.setrecursionlimit(300000)


def solve(N: int, A: "List[int]"):
    ret = [0] * N
    for a in A:
        ret[a - 1] += 1
    for r in ret:
        print(r)
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    A = [int(next(tokens)) for _ in range(N - 2 + 1)]  
    solve(N, A)

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
As = list(map(int, input().split()))
ct = [0] * N

for a in As:
    ct[a-1] += 1

for c in ct:
    print(c)

Solution (Python):


iim = lambda: map(int, input().rstrip().split())

def resolve():
    N = int(input())
    A = list(iim())

    S = [0] * N
    for ai in A:
        S[ai-1] += 1
    print(*S, sep="\n")

if __name__ == "__main__":
    resolve()

Solution (Python):
from math import gcd

from math import factorial as f

from math import ceil,floor,sqrt


import bisect
import re
import heapq


from copy import deepcopy
import itertools

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

yes = "Yes"
no = "No"

def main():
    n = ii()
    a = li()
    tmp = [0 for i in range(n+1)]
    for i in a:
        tmp[i]+=1
    for i in range(1,n+1):
        print(tmp[i])



main()

Solution (Python):
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) 
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    


MOD = 10**9 + 7
INF = 2**31  

from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  

N = read_a_int()
A = read_ints()

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

Solution (Python):
n = int(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])

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
b = [0 for i in range(n)]
for e in a:
  b[e-1] += 1
for e in b:
  print(e)

Solution (Python):
mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

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


if __name__ == '__main__':
    main()

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

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = LIST()

ans = [0]*N
for a in A:
	ans[a-1] += 1

print(*ans, sep="\n")