n = int(input()) tree = [[] for i in range(n)] for i in range(n-1): tmp1, tmp2 = map(int, input().split()) tree[tmp1 - 1].append(tmp2 - 1) tree[tmp2 - 1].append(tmp1 - 1) cnt = 0 for i in range(n): if len(tree[i]) == 1: cnt += 1 print(cnt - 2)