import sys input=lambda: sys.stdin.readline().rstrip() n=int(input()) A=[0]*n for _ in range(n-1): a,b=map(int,input().split()) A[a-1]+=1 A[b-1]+=1 ans=0 for i in range(n): if A[i]==1: ans+=1 print(ans-2)