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) order = [] st = [0] parent = [-1]*n while st: v = st.pop() order.append(v) for c in g[v]: if c != parent[v]: st.append(c) parent[c] = v d = [0]*n for i in order[1:][::-1]: if d[i]==0: d[parent[i]] = 1 print(d.count(1))