N = int(input()) edge = [[] for _ in range(N)] for i in range(N-1): u, v = map(int, input().split()) u -= 1 v -= 1 edge[u].append(v) edge[v].append(u) def dfs(now, prv = -1): global edge, dp # must, can cannot subDp = (1, 0, 0) for nxt in edge[now]: if nxt == prv: continue child = dfs(nxt, now) connect = child[0] + child[1] disConnect = child[1] + child[2] subDp = ( subDp[0] * disConnect, subDp[0] * connect + subDp[1] * disConnect, subDp[1] * connect + subDp[2] * disConnect ) return subDp print(sum(dfs(0)[1:]))