import sys sys.setrecursionlimit(10 ** 6) n = int(input()) G = [[] for i in range(n)] for _ in range(n - 1): u, v = map(int, input().split()) u -= 1; v -= 1 G[u].append(v) G[v].append(u) def dfs(now, prev): f = False for nex in G[now]: if nex == prev: continue dfs(nex, now) if used[nex]: f = True if not f: used[now] = 1 used = [0] * n dfs(0, -1) print(sum(used))