#import <Foundation/Foundation.h>
#import <stdio.h>

int main(int argc, char **argv) {
	NSInteger N;
    scanf("%ld", &N);
  	NSMutableArray<NSNumber *> *bosses = [[NSMutableArray alloc] init];
    for (NSInteger i = 0; i < N; i++) {
      [bosses addObject: @(0)];
    }
    for (NSInteger i = 0; i < N-1; i++) {
    	NSInteger boss;
        scanf("%ld", &boss);
        NSNumber *currentNumber = (NSNumber *)([bosses objectAtIndex: boss - 1]);
    	[bosses replaceObjectAtIndex: boss - 1 withObject: [NSNumber numberWithInteger: currentNumber.integerValue + 1]];
    }
    for (NSInteger i = 0; i < N; i++) {
      NSNumber *n = [bosses objectAtIndex: i];
      printf("%@\n", n);
    }
	return 0;
}