#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define vi vector<ll>
#define vvi vector<vi >
#define pi pair<ll,ll>
#define vvpi vector<vector<pi > >
#define vpi vector<pi >
#define vppi vector<pair<ll,pi > >
#define vs vector<string>
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define pb push_back
#define eb emplace_back
#define mkp make_pair
#define fs first
#define se second
#define fast ios_base::sync_with_stdio(false)
#define cintie cin.tie(NULL)
int main()
{
	ll n,i,x;
   cin>>n;
   vvi v(200010);
   for(i=2;i<=n;i++)
   {
   	  cin>>x;
   	  v[i].pb(x);
   	  v[x].pb(i);
   }
   for(i=1;i<=n;i++)
   {
   	  if(i==1)
   	  cout<<v[i].size()<<endl;
   	  else
   	  {
   	  	cout<<v[i].size()-1<<endl;
		 }
   }
}
