
import java.util.*;

public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer N = Integer.parseInt(scanner.next());
        Map<Integer, Integer> map = new HashMap<Integer, Integer>();

        for (int i = 0; i < N-1; i++) {
            Integer A = Integer.parseInt(scanner.next()) -1;
            Integer count = map.get(A);
            map.put(A, (count == null) ? 1 : count + 1);
        }

        Integer[] total = new Integer[N];
        Arrays.fill(total, 0);

        for (Integer nKey: map.keySet()) {
            total[nKey] = map.get(nKey);
        }

        for (int i = 0; i < N; i++) System.out.println(total[i]);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer N = Integer.parseInt(scanner.next());
        Map<Integer, Integer> map = new HashMap<Integer, Integer>();

        for (int i = 0; i < N-1; i++) {
            Integer A = Integer.parseInt(scanner.next()) -1;
            Integer count = map.get(A);
            map.put(A, (count == null) ? 1 : count + 1);
        }

        Integer[] total = new Integer[N];
        Arrays.fill(total, 0);

        for (Integer nKey: map.keySet()) {
            total[nKey] = map.get(nKey);
        }

        for (int i = 0; i < N; i++) System.out.println(total[i]);
    }
} Main public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer N = Integer.parseInt(scanner.next());
        Map<Integer, Integer> map = new HashMap<Integer, Integer>();

        for (int i = 0; i < N-1; i++) {
            Integer A = Integer.parseInt(scanner.next()) -1;
            Integer count = map.get(A);
            map.put(A, (count == null) ? 1 : count + 1);
        }

        Integer[] total = new Integer[N];
        Arrays.fill(total, 0);

        for (Integer nKey: map.keySet()) {
            total[nKey] = map.get(nKey);
        }

        for (int i = 0; i < N; i++) System.out.println(total[i]);
    } main {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer N = Integer.parseInt(scanner.next());
        Map<Integer, Integer> map = new HashMap<Integer, Integer>();

        for (int i = 0; i < N-1; i++) {
            Integer A = Integer.parseInt(scanner.next()) -1;
            Integer count = map.get(A);
            map.put(A, (count == null) ? 1 : count + 1);
        }

        Integer[] total = new Integer[N];
        Arrays.fill(total, 0);

        for (Integer nKey: map.keySet()) {
            total[nKey] = map.get(nKey);
        }

        for (int i = 0; i < N; i++) System.out.println(total[i]);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) Integer N = Integer.parseInt(scanner.next()); N Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner Map<Integer, Integer> map = new HashMap<Integer, Integer>(); map new HashMap<Integer, Integer>() for (int i = 0; i < N-1; i++) {
            Integer A = Integer.parseInt(scanner.next()) -1;
            Integer count = map.get(A);
            map.put(A, (count == null) ? 1 : count + 1);
        } int i = 0; int i = 0; i 0 i < N-1 i N-1 N 1 i++ i++ i {
            Integer A = Integer.parseInt(scanner.next()) -1;
            Integer count = map.get(A);
            map.put(A, (count == null) ? 1 : count + 1);
        } {
            Integer A = Integer.parseInt(scanner.next()) -1;
            Integer count = map.get(A);
            map.put(A, (count == null) ? 1 : count + 1);
        } Integer A = Integer.parseInt(scanner.next()) -1; A Integer.parseInt(scanner.next()) -1 Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner 1 Integer count = map.get(A); count map.get(A) map.get map A map.put(A, (count == null) ? 1 : count + 1) map.put map A (count == null) ? 1 : count + 1 (count == null) count null 1 count + 1 count 1 Integer[] total = new Integer[N]; total new Integer[N] N Arrays.fill(total, 0) Arrays.fill Arrays total 0 for (Integer nKey: map.keySet()) {
            total[nKey] = map.get(nKey);
        } Integer nKey map.keySet() map.keySet map {
            total[nKey] = map.get(nKey);
        } {
            total[nKey] = map.get(nKey);
        } total[nKey] = map.get(nKey) total[nKey] total nKey map.get(nKey) map.get map nKey for (int i = 0; i < N; i++) System.out.println(total[i]); int i = 0; int i = 0; i 0 i < N i N i++ i++ i System.out.println(total[i]); System.out.println(total[i]) System.out.println System.out System System.out total[i] total i String[] args args public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer N = Integer.parseInt(scanner.next());
        Map<Integer, Integer> map = new HashMap<Integer, Integer>();

        for (int i = 0; i < N-1; i++) {
            Integer A = Integer.parseInt(scanner.next()) -1;
            Integer count = map.get(A);
            map.put(A, (count == null) ? 1 : count + 1);
        }

        Integer[] total = new Integer[N];
        Arrays.fill(total, 0);

        for (Integer nKey: map.keySet()) {
            total[nKey] = map.get(nKey);
        }

        for (int i = 0; i < N; i++) System.out.println(total[i]);
    }
} public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer N = Integer.parseInt(scanner.next());
        Map<Integer, Integer> map = new HashMap<Integer, Integer>();

        for (int i = 0; i < N-1; i++) {
            Integer A = Integer.parseInt(scanner.next()) -1;
            Integer count = map.get(A);
            map.put(A, (count == null) ? 1 : count + 1);
        }

        Integer[] total = new Integer[N];
        Arrays.fill(total, 0);

        for (Integer nKey: map.keySet()) {
            total[nKey] = map.get(nKey);
        }

        for (int i = 0; i < N; i++) System.out.println(total[i]);
    }
} Main

import java.util.*;

public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer N = Integer.parseInt(scanner.next());
        Map<Integer, Integer> map = new HashMap<Integer, Integer>();

        for (int i = 0; i < N-1; i++) {
            Integer A = Integer.parseInt(scanner.next()) -1;
            Integer count = map.get(A);
            map.put(A, (count == null) ? 1 : count + 1);
        }

        Integer[] total = new Integer[N];
        Arrays.fill(total, 0);

        for (Integer nKey: map.keySet()) {
            total[nKey] = map.get(nKey);
        }

        for (int i = 0; i < N; i++) System.out.println(total[i]);
    }
}
