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