import sys sys.setrecursionlimit(10**6) input = sys.stdin.readline def dfs(v, p, used: list, graph): paintable = True for n in graph[v]: if n == p: continue dfs(n, v, used, graph) if used[n]: paintable = False if paintable: used[v] = True N = int(input()) graph = [[] for i in range(N)] for i in range(N - 1): a, b = map(int, input().split()) a, b = a - 1, b - 1 graph[a].append(b) graph[b].append(a) used = [False] * N dfs(0, -1, used, graph) print(sum(used))