import sys sys.setrecursionlimit(10 ** 9) import pypyjit pypyjit.set_param('max_unroll_recursion=-1') n = int(input()) edges = [[] for _ in range(n)] for _ in range(n - 1): u, v = map(int, input().split()) u -= 1 v -= 1 edges[u].append(v) edges[v].append(u) def dfs(pos, bpos): tmp = -2 for npos in edges[pos]: if npos == bpos: continue else: tmp += dfs(npos, pos) + 1 return max(0, tmp) ans = dfs(0, -1) print(n - ans)