import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N = int(readline()) m = map(int,read().split()) AB = zip(m,m) deg = [0] * (N+1) for a,b in AB: deg[a] += 1 deg[b] += 1 leaf = sum(x == 1 for x in deg) answer = leaf - 2 print(answer)