import java.util.Scanner;
class Main{
 public static void main(String args[]){
  Scanner scan = new Scanner(System.in);
  
  int n = scan.nextInt();
  int sup[] = new int[n+1];
  int ans[] = new int[n+1];
   ans[1] = 0;
  for(int i = 2; i<=n; i++){ //初期化
    sup[i] = scan.nextInt();
    ans[i] = 0;
  }
  for(int i = 2; i<= n; i++){
    ans[sup[i]]++;
  }
  for(int i = 1; i<= n; i++){
    System.out.println(ans[i]);
  }
 }
} import java.util.Scanner; Scanner java.util class Main{
 public static void main(String args[]){
  Scanner scan = new Scanner(System.in);
  
  int n = scan.nextInt();
  int sup[] = new int[n+1];
  int ans[] = new int[n+1];
   ans[1] = 0;
  for(int i = 2; i<=n; i++){ //初期化
    sup[i] = scan.nextInt();
    ans[i] = 0;
  }
  for(int i = 2; i<= n; i++){
    ans[sup[i]]++;
  }
  for(int i = 1; i<= n; i++){
    System.out.println(ans[i]);
  }
 }
} Main public static void main(String args[]){
  Scanner scan = new Scanner(System.in);
  
  int n = scan.nextInt();
  int sup[] = new int[n+1];
  int ans[] = new int[n+1];
   ans[1] = 0;
  for(int i = 2; i<=n; i++){ //初期化
    sup[i] = scan.nextInt();
    ans[i] = 0;
  }
  for(int i = 2; i<= n; i++){
    ans[sup[i]]++;
  }
  for(int i = 1; i<= n; i++){
    System.out.println(ans[i]);
  }
 } main {
  Scanner scan = new Scanner(System.in);
  
  int n = scan.nextInt();
  int sup[] = new int[n+1];
  int ans[] = new int[n+1];
   ans[1] = 0;
  for(int i = 2; i<=n; i++){ //初期化
    sup[i] = scan.nextInt();
    ans[i] = 0;
  }
  for(int i = 2; i<= n; i++){
    ans[sup[i]]++;
  }
  for(int i = 1; i<= n; i++){
    System.out.println(ans[i]);
  }
 } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int sup[] = new int[n+1]; sup new int[n+1] n+1 n 1 int ans[] = new int[n+1]; ans new int[n+1] n+1 n 1 ans[1] = 0 ans[1] ans 1 0 for(int i = 2; i<=n; i++){ //初期化
    sup[i] = scan.nextInt();
    ans[i] = 0;
  } int i = 2; int i = 2; i 2 i<=n i n i++ i++ i { //初期化
    sup[i] = scan.nextInt();
    ans[i] = 0;
  } { //初期化
    sup[i] = scan.nextInt();
    ans[i] = 0;
  } sup[i] = scan.nextInt() sup[i] sup i scan.nextInt() scan.nextInt scan ans[i] = 0 ans[i] ans i 0 for(int i = 2; i<= n; i++){
    ans[sup[i]]++;
  } int i = 2; int i = 2; i 2 i<= n i n i++ i++ i {
    ans[sup[i]]++;
  } {
    ans[sup[i]]++;
  } ans[sup[i]]++ ans[sup[i]] ans sup[i] sup i for(int i = 1; i<= n; i++){
    System.out.println(ans[i]);
  } int i = 1; int i = 1; i 1 i<= n i n i++ i++ i {
    System.out.println(ans[i]);
  } {
    System.out.println(ans[i]);
  } System.out.println(ans[i]) System.out.println System.out System System.out ans[i] ans i String args[] args
import java.util.Scanner;
class Main{
 public static void main(String args[]){
  Scanner scan = new Scanner(System.in);
  
  int n = scan.nextInt();
  int sup[] = new int[n+1];
  int ans[] = new int[n+1];
   ans[1] = 0;
  for(int i = 2; i<=n; i++){ //初期化
    sup[i] = scan.nextInt();
    ans[i] = 0;
  }
  for(int i = 2; i<= n; i++){
    ans[sup[i]]++;
  }
  for(int i = 1; i<= n; i++){
    System.out.println(ans[i]);
  }
 }
}
