n = int(input()) D = [0 for _ in range(n)] for _ in range(n - 1): a, b = map(int, input().split()) D[a - 1] += 1 D[b - 1] += 1 ans = 0 for i in range(n): if D[i] == 1: ans += 1 print(ans - 2)