stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



using ll = long long;

using ull = unsigned long long;



#define MOD 1000000007



int main(void) {

    ll N, K;

    ll count = 0;

    vector<ll> A;

    cin >> N >> K;

    A.resize(N);

    for(ll i = 0;i < K;i++) {

        ll d;

        cin >> d;

        for(ll j = 0;j < d;j++) {

            ll temp;

            cin >> temp;

            A[temp - 1]++;

        }

    }

    for(ll i = 0;i < A.size();i++) {

        if(A[i] == 0) count++;

    }

    cout << count << endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>



int main(void){

	int i,j;

	int N, K;

	int a[100] = {};

	int total = 0;

	scanf("%d%d",&N,&K);

	for(i = 0;i < K;i++){

        int d;

		scanf("%d", &d);

		for(j = 0;j < d;j++){

            int index;

			scanf("%d", &index);

			a[index - 1]++;

		}

	}

	for(i = 0;i < N;i++){

		if(a[i] == 0) total++;

	}

	printf("%d\n", total);

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

#define lli long long int

#define MOD 1000000007

#define KING 1000000002

#define queen 1000002

#define fi first

#define se second

#define se second

#define lsb(i) (i & -i)

#define nl cout<<'\n'

#define TEST cout<<"TEST",nl

#define pr pair<lli,lli>

#define pb push_back

#define eb emplace_back

#define mp make_pair

#define vi vector<lli>

#define vpi vector<pr> 

#define P pair<lli,pr>

#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL)

#define NA(i,s,n) for(lli i=s;i<n;i++)

using namespace std;



lli n;

vi gp[200002], ans(2e5+2);



void solve(){

    cin>>n; lli p;

    NA(i,2,n+1) cin>>p, gp[p].pb(i);

    NA(i,1,n+1) cout<<gp[i].size()<<'\n'; 

    return;

}    



int main(){

    fastIO;

    lli t = 1; 

    // cin>>t;

    NA(i,0,t) solve();

    return 0;

}


// Optimized solution to the same problem (faster):


#include<bits/stdc++.h>

#define lli long long int

#define MOD 1000000007

#define KING 1000000002

#define queen 1000002

#define fi first

#define se second

#define se second

#define lsb(i) (i & -i)

#define nl cout<<'\n'

#define TEST cout<<"TEST",nl

#define all(a) a.begin(), a.end()

#define pr pair<lli,lli>

#define pb push_back

#define eb emplace_back

#define mp make_pair

#define vi vector<lli>

#define vpi vector<pr> 

#define P pair<lli,pr>

#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL)

#define NA(i,s,n) for(lli i=s;i<n;i++)

using namespace std;



lli power(lli x,lli y,lli p) { 

	lli res = 1;	 

	x = x % p; 

	while (y > 0) 

	{ 

		if (y & 1) 

			res = (res*x) % p; 

		y = y>>1; 

		x = (x*x) % p; 

	} 

	return res; 

} 



lli n,a,b,c;



void solve(){

    lli n, p; cin>>n;

	vi a(n+1, 0);

	NA(i,2,n+1){

		cin>>p;

		++a[p];

	}

	NA(i,1,n+1) cout<<a[i]<<'\n';

    return;

}



int main(){

    fastIO;

    lli t = 1; 

    // cin>>t;

    NA(i,0,t) solve();

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
//**PEACE BE UPON YOU**

// AZMAYEN FAYEK SABIL

// IUT CSE SWE-19



#include <iostream>

#include <bits/stdc++.h>



#include <cmath>

#include <string>

#include <algorithm>

using namespace std;





int main()



{

    int n;

    cin>>n;



    int a[200005];

    int c[200005]={0};



    int i;



    for(i=1;i<n;i++)

    {

        cin>>a[i];

    }



    for(i=0;i<n;i++)

    {

       c[a[i]-1]++;

    }



    for(i=0;i<n;i++)

    {

        cout<<c[i]<<endl;

    }





    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main() {

	int i,n;

	scanf("%d",&n);

	int a;

	int b[n];

	for( i=0;i<n;i++) {

		b[i]=0;

	}

	for( i=0;i<n-1;i++){

		scanf("%d",&a);

		b[a-1]=b[a-1]+1;

	}

	for( i=0;i<n;i++) {

		printf("%d\n",b[i]);

	}

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <string>

#include <algorithm>

using namespace std;



int main()

{

    int n; cin >> n;

    int x;

    int cnt[2*100000] = { 0 };

    for (int i = 0; i < n - 1; i++)

    {

        cin >> x;

        cnt[x - 1]++;

    }

  

    

    for (int j = 0; j < n; j++)

    {

        cout << cnt[j] << endl;

    }

    return 0;

}






// Optimized solution to the same problem (faster):
#include<stdio.h>

int main() {

	int i,n;

	scanf("%d",&n);

	int a;

	int b[n];

	for( i=0;i<n;i++) {

		b[i]=0;

	}

	for( i=0;i<n-1;i++){

		scanf("%d",&a);

		b[a-1]=b[a-1]+1;

	}

	for( i=0;i<n;i++) {

		printf("%d\n",b[i]);

	}

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

#define pi acos(-1.0)

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

typedef long long ll;

typedef unsigned long long ull;



int main()

{

    fastio;

    ll t, i, n, p, q, r, d, f=0;

    char *ye="YES", *no="NO";

    cin>>n;

    ll a[n];

    for(i=0;i<n;i++) a[i]=0;

    for(i=0;i<n-1;i++){

        cin>>p;

        a[p-1]++;

    }

    for(i=0;i<n;i++) cout<<a[i]<<endl;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main() {

	int i,n;

	scanf("%d",&n);

	int a;

	int b[n];

	for( i=0;i<n;i++) {

		b[i]=0;

	}

	for( i=0;i<n-1;i++){

		scanf("%d",&a);

		b[a-1]=b[a-1]+1;

	}

	for( i=0;i<n;i++) {

		printf("%d\n",b[i]);

	}

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#define ll long long

#define pi acos(-1.0)

#define Go "\n"

#define bye return 0

#define Afor(i,b) for(int i=0;i<b;i++)

#include<bits/stdc++.h>

using namespace std;

int main()

{

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);



    ll N,i;

    cin>>N;

    ll A[N];

    ll B[N]={0};

    Afor(i,(N-1))

    {

        cin>>A[i];

        B[A[i]-1]++;



    }

    Afor(i,N)

    {

        cout<<B[i]<<Go;

    }

    bye;



}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main() {

	int i,n;

	scanf("%d",&n);

	int a;

	int b[n];

	for( i=0;i<n;i++) {

		b[i]=0;

	}

	for( i=0;i<n-1;i++){

		scanf("%d",&a);

		b[a-1]=b[a-1]+1;

	}

	for( i=0;i<n;i++) {

		printf("%d\n",b[i]);

	}

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#define ONSPEED ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);

#define pb push_back

#define f(i,x,n) for(i=x;i<n;i++)

#define rf(i,x,n) for(i=n;i>x;i--)

#define ll long long

#define GCD(a,b) __gcd(a,b)

#define adios return 0;



/*

SHERAJUL ARIFIN

Dept. of CSE,

IUT.

*/





#include <bits/stdc++.h>

using namespace std;



int main()

{

    ONSPEED;

    ll t,n,a,b,c,d,s=0,i,j,flag;

    string x,y;

    cin>>n;

    ll arr[n+5];

    ll ans[n+5]={0};

    for(i=2;i<=n;i++)

    {

        cin>>arr[i];

    }

    for(i=2;i<=n;i++)

    {

        ans[arr[i]]++;

    }

    for(i=1;i<=n;i++)

    {

        cout<<ans[i]<<endl;

    }







    adios;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main() {

	int i,n;

	scanf("%d",&n);

	int a;

	int b[n];

	for( i=0;i<n;i++) {

		b[i]=0;

	}

	for( i=0;i<n-1;i++){

		scanf("%d",&a);

		b[a-1]=b[a-1]+1;

	}

	for( i=0;i<n;i++) {

		printf("%d\n",b[i]);

	}

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

 

#define f(i,a,b) for( ll i = a; i < b ; i++ ) 

#define af(i,a,b) for( ll i = a; i >= b ; i--)

#define rep(i,a,b,k) for(ll i = a; i < b ; i+= k )

#define arep(i,a,b,k) for( ll i = a; i >= b ; i-= k)

#define ones(x) (ll) __builtin_popcount(x)

#define fs first

#define sc second

#define pb push_back

#define po pop_back

#define mp make_pair

#define sz(a) (ll) a.size()

#define all(a) a.begin(), a.end()

#define sor(a) sort( a.begin(), a.end() )

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL)

#define ller ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr)

#define yes cout<<"YES\n"

#define no cout<<"NO\n"

using namespace std;

 

typedef long long ll;

typedef long double ld;

typedef pair<ll,ll> ii ;

typedef vector<ll>  vi ;

typedef vector<ii> vii ;

 

const ll MAX = 100000;

const ll inf = 5e18;



int main() {

	fastio;

	ll n;

    cin>>n;

    vi ans(n);

    f(i,1,n){

        ll x;

        cin >> x;

        ans[x-1]++;

    }

    f(i,0,n){

        cout << ans[i] << endl;

    }

return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main() {

	int i,n;

	scanf("%d",&n);

	int a;

	int b[n];

	for( i=0;i<n;i++) {

		b[i]=0;

	}

	for( i=0;i<n-1;i++){

		scanf("%d",&a);

		b[a-1]=b[a-1]+1;

	}

	for( i=0;i<n;i++) {

		printf("%d\n",b[i]);

	}

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#define $ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

#define mod 1000000007

#define endl "\n"

typedef long long ll;

typedef long double ld;

using namespace std;



int main()

{

    $

    int n;

    cin >> n;

    int freq[n+1] = {0};

    for (int i = 1 ; i<n ; i++) {

        int x;cin >> x;

        freq[x]++;

    }

    for (int i = 1 ; i<=n ; i++) {

        cout << freq[i] << endl;

    }

    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main() {

	int i,n;

	scanf("%d",&n);

	int a;

	int b[n];

	for( i=0;i<n;i++) {

		b[i]=0;

	}

	for( i=0;i<n-1;i++){

		scanf("%d",&a);

		b[a-1]=b[a-1]+1;

	}

	for( i=0;i<n;i++) {

		printf("%d\n",b[i]);

	}

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <bits/stdc++.h>

#include<vector>

#include<queue>



using namespace std;



int main()

{

   map<int,int>mapi;

   int n,a;

   cin>>n;

   for(int i =0;i < n-1;i++)

   {

       cin>> a;

       mapi[a]++;

   }

   for(int j=1;j<=n;j++){

    cout<< mapi[j]<<endl;

   }

	return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main() {

	int i,n;

	scanf("%d",&n);

	int a;

	int b[n];

	for( i=0;i<n;i++) {

		b[i]=0;

	}

	for( i=0;i<n-1;i++){

		scanf("%d",&a);

		b[a-1]=b[a-1]+1;

	}

	for( i=0;i<n;i++) {

		printf("%d\n",b[i]);

	}

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;



int main()

{

  int n; cin >> n;

  int a[n+1];

  memset(a, 0, sizeof(a));

  for(int i = 1; i < n; i++)

  {

  	int x; cin >> x;

  	a[x]++;

  }

  for(int i= 1; i <= n; i++)

  cout << a[i] << endl;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main() {

	int i,n;

	scanf("%d",&n);

	int a;

	int b[n];

	for( i=0;i<n;i++) {

		b[i]=0;

	}

	for( i=0;i<n-1;i++){

		scanf("%d",&a);

		b[a-1]=b[a-1]+1;

	}

	for( i=0;i<n;i++) {

		printf("%d\n",b[i]);

	}

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#define PI acos(-1)

using namespace std;

int main()

{

    int n,a;

    cin>>n;

    int b[n+10]={0};

    int m=n-1;

    while(m--)

    {

        cin>>a;

        b[a]++;

    }

    for(int i=1; i<=n; i++)

    {

        cout<<b[i]<<"\n";

    }

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<math.h>



int n,i;

int main()

{

     scanf("%d",&n);

     int res[n],x,m;

     m=n-1; for(i=1;i<=n;i++) res[i]=0;







    while(m--)

    {

        scanf("%d",&x);

        res[x]++;

    }

    for( i=1;i<=n;i++) printf("%d\n",res[i]);



}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <array>



using namespace std;



#define Rep(i, n) for(int i = 0; i < (int)(n); ++i)



int main() {

  array<int, 200000> count;

  fill(count.begin(), count.end(), 0);



  int n;

  cin >> n;

  Rep(i, n - 1) {

    int a;

    cin >> a;

    count[a - 1]++;

  }



  Rep(i, n) {

    cout << count[i] << endl;

  }

  return 0;

}


// Optimized solution to the same problem (faster):
#include <iostream>

#include <vector>



using namespace std;



#define Rep(i, n) for(int i = 0; i < (int)(n); ++i)



int main() {



  int n;

  cin >> n;

  vector<int> count(n, 0);

  Rep(i, n - 1) {

    int a;

    cin >> a;

    count[a - 1]++;

  }



  Rep(i, n) {

    cout << count[i] << endl;

  }

  return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;



int main()

{

    int n; cin >> n;



    vector<int> num(1000000);

    

    for (int i = 2; i <= n; i++) {

        int tmp_a;

        cin >> tmp_a;

        num[tmp_a]++;

    }



    for (int i = 1; i <= n ; i++) {

        cout << num[i] << endl;

    }



    return 0;



}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;



int main()

{

    int n; cin >> n;



    vector<int> num(200001, 0);



    for (int i = 2; i <= n; i++) {

        int tmp; cin >> tmp;

        num[tmp]++;

    }



    for (int i = 1; i <= n; i++) {

        cout << num[i] << endl;

    }



    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <vector>



int main()

{

    using std::cin;

    using std::cout;



    int N;

    cin >> N;



    std::vector A(2 * 100010, 0);

    for (int i = 0; i < N - 1; i++) {

        int a;

        cin >> a;

        A[a - 1]++;

    }



    for (int i = 0; i < N; i++) {

        cout << A[i] << '\n';

    }

}

// Optimized solution to the same problem (faster):
#include <iostream>

#include <vector>



int main()

{

    int N; std::cin >> N;



    std::vector A(N, 0);

    for (int i = 0; i < N - 1; i++) {

        int a; std::cin >> a;

        A[a - 1]++;

    }



    for (int i = 0; i < N; i++) {

        std::cout << A[i] << '\n';

    }

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int num;

         int n;

     int ans[200010]={0};



   cin>>n;

    for(int i=2; i<=n; i++)

    {

        scanf("%d",&num);



        ans[num]++;

    }

    for(int i=1; i<=n; i++)

    {

        printf("%d\n",ans[i]);

    }

}


// Optimized solution to the same problem (faster):
#include <stdio.h>



int main()

{

    int n,arr[200001]={},i,j,p;

    scanf("%d",&n);

    for(i=1;i<=n-1;i++) {

        scanf("%d",&p);

        arr[p]++;

    }

    for(j=1;j<=n;j++) {

        printf("%d\n",arr[j]);

    }



    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;



int main() {



    long long n, x, arr[int(2e5 + 5)]{};



    cin >> n;

    for (int i = 0; i < n - 1; i++)

    {

        cin >> x;

        arr[x]++;

    }

    for (int i = 1; i <= n; i++)

    {

        cout << arr[i];

        if (n != 1 && i != n)

            cout <<"\n";

    }



    return 0;

}

// Optimized solution to the same problem (faster):
#include<bits/stdc++.h>

using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)



 

int main(){

	int n;

	map<int,int>mp;

	cin>>n;

	vector<int>a(n);

	rep(i,n-1){

		cin>>a[i];

		mp[a[i]]++;

	}

	// for(auto p:mp){

	// 	cout<<p.second<<endl;

	// }

	for(int i=1;i<=n;++i){

		cout<<mp[i]<<endl;

	}

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int64_t N,A,b[200001]={};

    int64_t i,j,k;



    cin>>N;

    for(i=2;i<=N;i++){

        cin>>A;

        b[A]++;

    }

    for(i=1;i<=N;i++){

        cout<<b[i]<<endl;

    }

    return 0;



}


// Optimized solution to the same problem (faster):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    long long num;

    while(cin>>num)

    {

        long long arr[num+5],count[num+5]={0};

        for(long long i=0;i<num-1;i++)

        {

            cin>>arr[i];

            count[arr[i]]++;

        }

        for(long long i=1;i<=num;i++)

        {

            cout<<count[i]<<endl;

        }

      break;

    }

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;



int main()

{

 int n; cin >> n;

 int num_of_sub[200001]={0};

 for(int i=0;i<n-1;i++)

 {

  int temp; cin>> temp;  num_of_sub[temp]++;

 }

 for(int i=1;i<n+1;i++)

 {

   cout<<num_of_sub[i]<<"\n";

 }

}


// Optimized solution to the same problem (faster):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    long long num;

    while(cin>>num)

    {

        long long arr[num+5],count[num+5]={0};

        for(long long i=0;i<num-1;i++)

        {

            cin>>arr[i];

            count[arr[i]]++;

        }

        for(long long i=1;i<=num;i++)

        {

            cout<<count[i]<<endl;

        }

      break;

    }

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#define FRU                                  freopen("out.txt","w",stdout);

#define FRO                                  freopen("in.txt","r",stdin);

#define pb                                   push_back

#define pf                                   push_front

#define ppb                                  pop_back()

#define ppf                                  pop_front()

#define mp                                   make_pair

#define ff                                   first

#define ss                                   second

#define flash                                ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);

#define mem(ara,n)                           memset(ara,n,sizeof ara)

#define fr(i,j,n)                            for(i=j;i<n;i++)

#define rf(i,j,n)                            for(i=n;i>=j;i--)

#define inf                                  2147483647

#define ll                                   long long

#define ull                                  unsigned long long

#define pii                                  pair<int,int>

#define vi                                   vector<int>

#define vll                                  vector <long long>

#define vch                                  vector <char>

#define itr                                  ::iterator

#define msi                                  map<string,int>

#define psi                                  pair <string,int>

#define vii                                  vector <pair<int,int> >

#define all(n)                               n.begin(),n.end()

#define INF                                  10000000000000000LL

#define pi                                   3.1415926535897932384626434

#define sii                                  set <int>

#define max3(a,b,c)                          max(a,max(b,c))

#define min3(a,b,c)                          min(a,min(b,c))

#define mid3(a,b,c)                          min(max(a,b),max(b,c),max(a,b))

#define max4(a,b,c,d)                        max(max(a,b),max(c,d))

#define min4(a,b,c,d)                        min(min(a,b),min(c,d))

#define endl                                 '\n'

#define endll                                cout<<"\n";

#define spc                                  ' '

#define ld                                   long double



using namespace std;







int main()

{

    flash

    string s,st;

    int n,t,T,i,j,J,I,k,m;

    char ch;

    cin>>n;

    int boss[200005]={0};

    fr(i,1,n)

    {

        cin>>m;

        boss[m]++;

    }

    fr(i,1,n+1)cout<<boss[i]<<endl;

    return 0;

}






// Optimized solution to the same problem (faster):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    long long num;

    while(cin>>num)

    {

        long long arr[num+5],count[num+5]={0};

        for(long long i=0;i<num-1;i++)

        {

            cin>>arr[i];

            count[arr[i]]++;

        }

        for(long long i=1;i<=num;i++)

        {

            cout<<count[i]<<endl;

        }

      break;

    }

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<set>

#include<cstring>



using namespace std;



int arr[200005];



int main()

{

    int n, a;

    while(cin >> n) {

        memset(arr, 0, sizeof(arr));

        n--;

        for(int i = 0; i < n; i++) {

            cin >> a;

            arr[a]++;

        }

        for(int i = 1; i <= n+1; i++)

            cout << arr[i] << endl;

    }

    return 0;

}


// Optimized solution to the same problem (faster):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    long long num;

    while(cin>>num)

    {

        long long arr[num+5],count[num+5]={0};

        for(long long i=0;i<num-1;i++)

        {

            cin>>arr[i];

            count[arr[i]]++;

        }

        for(long long i=1;i<=num;i++)

        {

            cout<<count[i]<<endl;

        }

      break;

    }

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



#define rep(i, n) for (int i = 0; i < n; i++)

#define repr(i, n) for (int i = n-1; i >= 0; i--)

#define ALL(x) x.begin(),x.end()



using ll = long long;

using pii = pair<int, int>;

using vi = vector<int>;



const int mod = 1e9+7;

const ll INF = 1e18;

const int MAX = 2e6;



// int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};



struct edge {int to, cost;}; // 辺

// vector<edge> graph[MAX]; // 隣接リスト

// bool visit[MAX]; // 訪問状況



int n, m; // 変数

int sub[MAX];



int main() {

// input

    cin >> n;

    memset(sub, 0, sizeof(sub));

    rep(i, n+1) {

        int boss;

        if (i > 1) {

            cin >> boss;

            sub[boss]++;

        }

    }

// solve

// output

    rep(i, n+1) {

        if (i > 0) cout << sub[i] << "\n";

    }

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;



#define rep(i, n) for (int i = 0; i < n; i++)

#define repr(i, n) for (int i = n-1; i >= 0; i--)

#define ALL(x) x.begin(),x.end()



using ll = long long;

using pii = pair<int, int>;

using vi = vector<int>;



const int mod = 1e9+7;

const ll INF = 1e18;

const int MAX = 1e6;



// int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};



struct edge {int to, cost;}; // 辺

// vector<edge> graph[MAX]; // 隣接リスト

// bool visit[MAX]; // 訪問状況



int n, m; // 変数

int sub[MAX];



int main() {

// input

    cin >> n;

    rep(i, n+1) {

        int boss;

        if (i > 1) {

            cin >> boss;

            sub[boss]++;

        }

    }

// solve

// output

    rep(i, n+1) {

        if (i > 0) cout << sub[i] << "\n";

    }

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



typedef long long ll;

typedef long double ld;

typedef unsigned long long ull;



const int N = 200005;

int cnt[N];



int main(){

	ios::sync_with_stdio(false);

	cin.tie(NULL);

	cout.tie(NULL);

	cout<<setprecision(32);



	int n, x;

	cin>>n;

	memset(cnt, 0, sizeof(cnt));

	for(int i = 2; i <= n; i++){

		cin>>x;

		cnt[x]++;

	}

	for(int i = 1; i <= n; i++){

		cout<<cnt[i]<<'\n';

	}





	return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;



typedef long long ll;

typedef long double ld;

typedef unsigned long long ull;



int main(){

	ios::sync_with_stdio(false);

	cin.tie(NULL);

	cout.tie(NULL);

	cout<<setprecision(32);



	int n;

	cin>>n;

	vector<int> deg(n);

	for(int i = 1; i < n; i++){

		int x;

		cin>>x;

		deg[x - 1]++;

	}

	for(auto x : deg){

		cout<<x<<"\n";

	}



	return 0;

}

// Fastest known solution for this problem: