n = int(input()) g = [[] for _ in range(n)] for i in range(n-1): a,b = map(int,input().split()) g[a-1].append(b-1) g[b-1].append(a-1) q = [0] parent = [-1]*n for v in q: for c in g[v]: if c != parent[v]: q.append(c) parent[c] = v r = [1]*n for i in q[::-1]: if r[i] and i: r[parent[i]] = 0 print(sum(r))