N = int(input()) c = [-2]*N for i in range(N-1): a,b = map(int,input().split()) c[a-1] += 1 c[b-1] += 1 csum = sum(map(abs,c)) print(int((csum-2)/2))