import sys sys.setrecursionlimit(10**6) input = sys.stdin.readline mod = 10**9 + 7 N = int(input()) graph = [[] for i in range(N)] def dfs(v, p): s1, s0 = 1, 0 for u in graph[v]: if u == p: continue sum_s1, sum_s0 = dfs(u, v) s1 += sum_s0 s0 += sum_s1 return s1, s0 for i in range(N - 1): a, b = map(int, input().split()) a, b = a - 1, b - 1 graph[a].append(b) graph[b].append(a) print(max(dfs(0, -1)))