from collections import defaultdict, deque n = int(input()) G = defaultdict(set) C = [0 for _ in range(n)] for _ in range(n - 1): u, v = map(int, input().split()) u -= 1 v -= 1 C[u] += 1 C[v] += 1 G[u].add(v) G[v].add(u) for u in range(n): if C[u] >= 3: for v in G[u]: G[v].remove(u) G[u] = set() C[u] = 0 ans = 0 seen = set() for i in range(n): if C[i] > 0 and i not in seen: seen.add(i) Que = deque([i]) num = 1 while Que: cp = Que.popleft() for np in G[cp]: if np in seen: continue seen.add(np) num += 1 Que.append(np) ans += (num + 1) // 2 print(ans)