from collections import defaultdict N = int(input()) adj_dict = defaultdict(list) for _ in range(N-1): a_i, b_i = map(int, input().split()) adj_dict[a_i].append(b_i) adj_dict[b_i].append(a_i) degree1 = 0 for i in range(1, N+1): if len(adj_dict[i]) == 1: degree1 += 1 print(degree1 - 2)