import sys sys.setrecursionlimit(10**8) def one_str(): return input() def many_int(): return list(map(int, input().split())) from collections import deque 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) deq = deque([]) def dfs(node, old_node): global G temp_deq = deque([]) now_dim = max(dim_num[node]-2, 0) if now_dim > 0: temp_deq.append([node, now_dim]) for next_node in G[node]: if old_node!=next_node: temp_deq += dfs(next_node, node) if temp_deq: if dim_num[node]==1: if temp_deq[0][1]==0: temp_deq.popleft() temp_deq[0][1]-=1 dim_num[temp_deq[0][0]] -= 1 dim_num[node] += 1 return temp_deq dim_num = {k:len(v)-1 for k, v in G.items()} dim_num[1] += 1 dfs(1, -1) count = 0 for k, v in dim_num.items(): count += min(2, v) print(count+1)