N = int(input()) E = [[] for _ in range(N)] for _ in range(N-1): a,b = map(int, input().split()) E[a-1].append(b-1) E[b-1].append(a-1) ans = 0 for e in E: ans += max(0, len(e)-2) print(ans)