stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <iostream>

#include <iomanip>

#include <algorithm>

#include <vector>

#define debug(x) cout << #x << "==" << x << endl;

using namespace std;



const int INF = 1e+8;



//??\???

#define MAX_N 50000

#define MAX_M 20

int N;

int M;

int C[MAX_M];



// dp ????????????

int dp[MAX_N + 1];





void print_dp_array(int n) {

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

    if(dp[i] == INF) {

      cout <<  "INF ";

    } else {

      cout << setw(3) << dp[i];

    }

  }

  cout << endl;

}





int main() {

  ios::sync_with_stdio(false);



  cin >> N >> M;

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

    cin >> C[i];

  }



  // ?????????

  fill(dp, dp + MAX_N + 1, INF);

  dp[0] = 0;





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



    if(dp[s] != INF) {

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

        dp[s + C[i]] = min(dp[s + C[i]], dp[s] + 1);

      }

    }

  }





  cout << dp[N] << endl;





  return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.177070434371439x):
#include <iostream>

#include <iomanip>

#include <algorithm>

#include <vector>

#include <map>

#define debug(x) cout << #x << "==" << x << endl;



using namespace std;



const int INF = 1e+8;



//??\???

#define MAX_N 50000

#define MAX_M 20

int N;

int M;

int C[MAX_M];



// dp ????????????

map<int,int> dp;





int least_coins(int s) {



  if(s < 0) { return INF; }     // checked ??§ out of bounds ??????????????????!!

  if(s == 0) { return 0; }



  if( dp.count(s) == 1 ) { return dp[s]; }



  int mn = INF;

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

    mn = min( mn, least_coins( s - C[i] ) + 1 );

  }





  return dp[s] = mn;



}



int main() {

  ios::sync_with_stdio(false);



  cin >> N >> M;

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

    cin >> C[i];

  }



  cout << least_coins(N) << endl;



  return 0;

}
// Slower C++ solution:
#include <iostream>

#include <iomanip>

#include <algorithm>

#include <vector>

#define debug(x) cout << #x << "==" << x << endl;

using namespace std;



const int INF = 1e+8;



//??\???

#define MAX_N 50000

#define MAX_M 20

int N;

int M;

int C[MAX_M];



// dp ????????????

int dp[MAX_N + 1];



void print_dp_array(int n) {

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

    if(dp[i] == INF) {

      cout <<  "INF ";

    } else {

      cout << setw(3) << dp[i];

    }

  }

  cout << endl;

}



int main() {

  ios::sync_with_stdio(false);



  cin >> N >> M;

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

    cin >> C[i];

  }



  // ?????????

  fill(dp, dp + MAX_N + 1, INF);

  dp[0] = 0;





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



    if(dp[s] != INF) {

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

        dp[s + C[i]] = min(dp[s + C[i]], dp[s] + 1);

      }

    }

  }





  cout << dp[N] << endl;





  return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.193308330244409x):
#include <iostream>

#include <vector>



using namespace std;



#define debug(x) cout << #x << "==" << x << endl;



const int inf = 100000000;



typedef long long ll;



int main() {

  ios::sync_with_stdio(false);



  int N, M;

  cin >> N >> M;



  vector<int> c(M);

  for(int i = 0; i < M; i++) { cin >> c[i]; }



  vector<int> dp(N+1, inf);       // dp[i] : i円を払うための最小枚数

  dp[0] = 0;

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

    for(int j = 0; j < M; j++) {

      if( c[j] <= i ) {

        dp[i] = min(dp[i], dp[i-c[j]] + 1);

      }

    }

  }



  cout << dp[N] << "\n";



  return 0;

}
// Slower C++ solution:
#include <iostream>

#include <iomanip>

#include <algorithm>

#include <vector>

#define debug(x) cout << #x << "==" << x << endl;

using namespace std;



const int INF = 1e+8;



//??\???

#define MAX_N 50000

#define MAX_M 20

int N;

int M;

int C[MAX_M];



// dp ????????????

int dp[MAX_N + 1];





void print_dp_array(int n) {

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

    if(dp[i] == INF) {

      cout <<  "INF ";

    } else {

      cout << setw(3) << dp[i];

    }

  }

  cout << endl;

}





int main() {

  ios::sync_with_stdio(false);



  cin >> N >> M;

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

    cin >> C[i];

  }



  // ?????????

  fill(dp, dp + MAX_N + 1, INF);

  dp[0] = 0;





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



    if(dp[s] != INF) {

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

        dp[s + C[i]] = min(dp[s + C[i]], dp[s] + 1);

      }

    }

  }





  cout << dp[N] << endl;





  return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.193308330244409x):
#include <iostream>

#include <vector>



using namespace std;



#define debug(x) cout << #x << "==" << x << endl;



const int inf = 100000000;



typedef long long ll;



int main() {

  ios::sync_with_stdio(false);



  int N, M;

  cin >> N >> M;



  vector<int> c(M);

  for(int i = 0; i < M; i++) { cin >> c[i]; }



  vector<int> dp(N+1, inf);       // dp[i] : i円を払うための最小枚数

  dp[0] = 0;

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

    for(int j = 0; j < M; j++) {

      if( c[j] <= i ) {

        dp[i] = min(dp[i], dp[i-c[j]] + 1);

      }

    }

  }



  cout << dp[N] << "\n";



  return 0;

}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 5.300530838452941x):
#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;

}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 8.186472140065472x):


#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;

}
// Slower C++ solution:
//**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;

}


// Faster C++ solution for the same problem (measured speedup: 1.8089194505518544x):
#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;

}
// Slower C++ solution:
//**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;

}


// Faster C++ solution for the same problem (measured speedup: 1.8090289182207044x):
#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;



}
// Slower C++ solution:
//**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;

}


// Faster C++ solution for the same problem (measured speedup: 1.795091052065687x):
#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;

}
// Slower C++ solution:
//**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;

}


// Faster C++ solution for the same problem (measured speedup: 1.8064019205323067x):
#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;

}
// Slower C++ solution:
//**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;

}


// Faster C++ solution for the same problem (measured speedup: 1.80867015031677x):
#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;

}
// Slower C++ solution:
//**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;

}


// Faster C++ solution for the same problem (measured speedup: 1.808789290545655x):
#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;

}
// Slower C++ solution:
//**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;

}


// Faster C++ solution for the same problem (measured speedup: 1.8317408434222242x):
#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;

}
// Slower C++ solution:
#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;

}






// Faster C++ solution for the same problem (measured speedup: 1.8127655772577642x):
#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;

}
// Slower C++ solution:
//**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;

}


// Faster C++ solution for the same problem (measured speedup: 9.514910901715698x):
#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]);

	}

}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 5.259997010266514x):
#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]);

	}

}
// Slower C++ solution:
#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;



}


// Faster C++ solution for the same problem (measured speedup: 5.259678718167878x):
#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]);

	}

}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 5.300517146897083x):
#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]);

	}

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.267327715701202x):
#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]);

	}

}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 5.2607220283086225x):
#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]);

	}

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.260375518281263x):
#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]);

	}

}
// Slower C++ solution:
#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;

}






// Faster C++ solution for the same problem (measured speedup: 9.41634457474891x):
#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]);

	}

}