import sys sys.setrecursionlimit(10 ** 9) 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) used = [False] * n dp = [0] * n def dfs(pos, bpos): for npos in edges[pos]: if npos == bpos: continue dfs(npos, pos) dp[pos] += dp[npos] if not used[npos] and not used[pos]: used[pos] = True dp[pos] += 1 dfs(0, -1) print(dp[0])