n = int(input()) deg = [0]*n for _ in range(n-1): a,b = map(int,input().split()) deg[a-1] += 1 deg[b-1] += 1 print(deg.count(1) - 2)