let () = Scanf.scanf "%d\n" @@ fun n ->
  let cs = Array.make n 0 in
  for i = 2 to n do
    Scanf.scanf "%d " @@ fun a ->
      cs.(a - 1) <- 1 + cs.(a - 1)
  done;
  Array.iter (Printf.printf "%d\n") cs
