N = int(input()) degree = [0] * N for _ in range(N - 1): a, b = [int(i) - 1 for i in input().split()] degree[a] += 1 degree[b] += 1 print(sum(d for d in degree if d >= 2) - 2)