#yuki806 n=int(raw_input()) d=[0]*n for i in xrange(n-1): a,b=map(int,raw_input().split()) d[a-1]+=1 d[b-1]+=1 print d.count(1)-2