N = int(input()) l = [[]for _ in range(N)] for _ in range(N-1): a,b = [int(i)-1 for i in input().split()] l[a].append(b) l[b].append(a) ans = 0 for lis in l: if len(lis) > 2: ans += len(lis)-2 print(ans)