N = int(input()) e = [[] for _ in range(N)] for _ in range(N-1): u, v = map(lambda x: int(x) - 1, input().split()) e[u].append(v) e[v].append(u) for v in range(N): q = e[v] cnt = sum([len(e[i]) - 1 for i in q]) print(cnt)