program example
    implicit none

    integer(8) i,N
    integer(8),allocatable :: A(:),B(:)

    read(*,*) N

    allocate(A(1:N-1),B(N))

    read(*,*) A

    B=0

    do i=1,N-1

    B(A(i))=B(A(i))+1

    end do

    do i=1,N
        write(*,*) B(i)
    end do


end program example
