import sys from collections import deque, Counter sys.setrecursionlimit(5 * 10 ** 5) from pypyjit import set_param set_param('max_unroll_recursion=-1') input = lambda: sys.stdin.readline().rstrip() ii = lambda: int(input()) mi = lambda: map(int, input().split()) li = lambda: list(mi()) inf = 2 ** 63 - 1 mod = 998244353 def solve(n, AB): dp = [[0] * 2 for _ in range(n)] s = set() graph = [[] for _ in range(n)] for a, b in AB: graph[a - 1].append(b - 1) graph[b - 1].append(a - 1) s.add(0) def dfs(now): dp[now][0] = dp[now][1] = 1 des = [] for to in graph[now]: if to not in s: des.append(to) s.add(to) dfs(to) for to in des: dp[now][0] *= (dp[to][0] + dp[to][1]) dp[now][0] %= mod P = dp[now][0] dp[now][1] = P for to in des: P *= pow(dp[to][0] + dp[to][1], mod - 2, mod) P %= mod P *= dp[to][1] P %= mod dp[now][1] += P dp[now][1] %= mod P *= pow(dp[to][1], mod - 2, mod) P %= mod P *= (dp[to][0] + dp[to][1]) P %= mod dfs(0) return dp[0][1] class dsu(): n=1 parent_or_size=[-1 for i in range(n)] def __init__(self,N): self.n=N self.num = N self.parent_or_size=[-1 for i in range(N)] def merge(self,a,b): assert 0<=a0: result2.append(result[i]) return result2 def count(self): return self.num def solve_gu(n, AB): ans = 0 for bit in range(1 << (n - 1)): U = dsu(n) for i in range(n - 1): if 1 & (bit >> i): a, b = AB[i] U.merge(a - 1, b - 1) cnt = 1 for v in U.groups(): cnt *= len(v) cnt %= mod ans += cnt ans %= mod return ans n = ii() AB = [li() for _ in range(n - 1)] if n < 21: print(solve_gu(n, AB)) else: print(solve(n, AB))