import sys sys.setrecursionlimit(10**7) def one_str(): return input() def many_int(): return list(map(int, input().split())) input_count = 0 N = many_int()[0] G = {i+1:[] for i in range(N)} for i in range(N-1): x,y = many_int() G[x].append(y) G[y].append(x) def dfs(node, old_node): global G now_dim = max(dim_num[node]-2, 0) amari = 0 for next_node in G[node]: if old_node!=next_node: amari += dfs(next_node, node) if dim_num[node]==1: dim_num[node] += 1 return now_dim + amari -1 else: return now_dim + amari dim_num = {k:len(v)-1 for k, v in G.items()} dim_num[1] += 1 print(N-max(dfs(1, -1), 0))