#!/usr/bin/env python3 # from typing import * import sys import io import math import collections import decimal import itertools import bisect import heapq def input(): return sys.stdin.readline()[:-1] # sys.setrecursionlimit(1000000) # _INPUT = """12 # 1 2 # 2 3 # 3 4 # 4 5 # 1 6 # 6 7 # 6 8 # 7 11 # 7 12 # 8 9 # 9 10 # """ # sys.stdin = io.StringIO(_INPUT) INF = 10**10 def dfs(parent, p): leaf = True for p1 in G[p]: if p1 == parent: continue dfs(p, p1) if Deleted[p1] == 0: leaf = False if not leaf: Deleted[p] = 1 N = int(input()) G = [list() for _ in range(N)] for _ in range(N-1): u, v = map(int, input().split()) G[u-1].append(v-1) G[v-1].append(u-1) Deleted = [0] * N dfs(-1, 0) ans = Deleted.count(0) print(ans)