import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    Map<String,Integer> su = new LinkedHashMap<String,Integer>();
    su.put("1",0);
    for(int i = 2; i <= n; i++){
    	String num = String.valueOf(i);
      su.put(num,0);
    }
    for(int i = 0; i < n-1; i++){
      String j = sc.next();
      int temp = su.get(j) + 1;
      su.put(j,temp);
    }
    sc.close();
    for(String ans : su.keySet()){
      System.out.println(su.get(ans));
    }
  }
} import java.util.LinkedHashMap; LinkedHashMap java.util import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    Map<String,Integer> su = new LinkedHashMap<String,Integer>();
    su.put("1",0);
    for(int i = 2; i <= n; i++){
    	String num = String.valueOf(i);
      su.put(num,0);
    }
    for(int i = 0; i < n-1; i++){
      String j = sc.next();
      int temp = su.get(j) + 1;
      su.put(j,temp);
    }
    sc.close();
    for(String ans : su.keySet()){
      System.out.println(su.get(ans));
    }
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    Map<String,Integer> su = new LinkedHashMap<String,Integer>();
    su.put("1",0);
    for(int i = 2; i <= n; i++){
    	String num = String.valueOf(i);
      su.put(num,0);
    }
    for(int i = 0; i < n-1; i++){
      String j = sc.next();
      int temp = su.get(j) + 1;
      su.put(j,temp);
    }
    sc.close();
    for(String ans : su.keySet()){
      System.out.println(su.get(ans));
    }
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    Map<String,Integer> su = new LinkedHashMap<String,Integer>();
    su.put("1",0);
    for(int i = 2; i <= n; i++){
    	String num = String.valueOf(i);
      su.put(num,0);
    }
    for(int i = 0; i < n-1; i++){
      String j = sc.next();
      int temp = su.get(j) + 1;
      su.put(j,temp);
    }
    sc.close();
    for(String ans : su.keySet()){
      System.out.println(su.get(ans));
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc Map<String,Integer> su = new LinkedHashMap<String,Integer>(); su new LinkedHashMap<String,Integer>() su.put("1",0) su.put su "1" 0 for(int i = 2; i <= n; i++){
    	String num = String.valueOf(i);
      su.put(num,0);
    } int i = 2; int i = 2; i 2 i <= n i n i++ i++ i {
    	String num = String.valueOf(i);
      su.put(num,0);
    } {
    	String num = String.valueOf(i);
      su.put(num,0);
    } String num = String.valueOf(i); num String.valueOf(i) String.valueOf String i su.put(num,0) su.put su num 0 for(int i = 0; i < n-1; i++){
      String j = sc.next();
      int temp = su.get(j) + 1;
      su.put(j,temp);
    } int i = 0; int i = 0; i 0 i < n-1 i n-1 n 1 i++ i++ i {
      String j = sc.next();
      int temp = su.get(j) + 1;
      su.put(j,temp);
    } {
      String j = sc.next();
      int temp = su.get(j) + 1;
      su.put(j,temp);
    } String j = sc.next(); j sc.next() sc.next sc int temp = su.get(j) + 1; temp su.get(j) + 1 su.get(j) su.get su j 1 su.put(j,temp) su.put su j temp sc.close() sc.close sc for(String ans : su.keySet()){
      System.out.println(su.get(ans));
    } String ans su.keySet() su.keySet su {
      System.out.println(su.get(ans));
    } {
      System.out.println(su.get(ans));
    } System.out.println(su.get(ans)) System.out.println System.out System System.out su.get(ans) su.get su ans String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    Map<String,Integer> su = new LinkedHashMap<String,Integer>();
    su.put("1",0);
    for(int i = 2; i <= n; i++){
    	String num = String.valueOf(i);
      su.put(num,0);
    }
    for(int i = 0; i < n-1; i++){
      String j = sc.next();
      int temp = su.get(j) + 1;
      su.put(j,temp);
    }
    sc.close();
    for(String ans : su.keySet()){
      System.out.println(su.get(ans));
    }
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    Map<String,Integer> su = new LinkedHashMap<String,Integer>();
    su.put("1",0);
    for(int i = 2; i <= n; i++){
    	String num = String.valueOf(i);
      su.put(num,0);
    }
    for(int i = 0; i < n-1; i++){
      String j = sc.next();
      int temp = su.get(j) + 1;
      su.put(j,temp);
    }
    sc.close();
    for(String ans : su.keySet()){
      System.out.println(su.get(ans));
    }
  }
} Main
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    Map<String,Integer> su = new LinkedHashMap<String,Integer>();
    su.put("1",0);
    for(int i = 2; i <= n; i++){
    	String num = String.valueOf(i);
      su.put(num,0);
    }
    for(int i = 0; i < n-1; i++){
      String j = sc.next();
      int temp = su.get(j) + 1;
      su.put(j,temp);
    }
    sc.close();
    for(String ans : su.keySet()){
      System.out.println(su.get(ans));
    }
  }
}