from collections import defaultdict class Graph(object): def __init__(self): self.graph = defaultdict(list) def __len__(self): return len(self.graph) def add_edge(self, a, b): self.graph[a].append(b) def get_nodes(self): return self.graph.keys() g_a = Graph() N = int(input()) for i in range(N - 1): a, b = list(map(int, input().split())) g_a.add_edge(a, b) g_a.add_edge(b, a) ans = -2 for i in g_a.graph: if len(g_a.graph[i]) == 1: ans += 1 print(ans)