n = int(input())
s = input().split()
count = 0
for i in range(n-1):
    if s[i] == '1':
        count += 1
print(count)
for i in range(n-1):
    count = 0
    num = i + 2
    for j in range(i+1,n-1):
        NUM = int(s[j])
        if NUM == num:
            count += 1
    print(count)
