N = int(input()) G = [0 for k in range(N)] for k in range(N-1): a, b = map(int,input().split()) G[a-1] += 1 G[b-1] += 1 G = sorted(G) print(G.count(1)-2)