#include #if __has_include() #include using namespace atcoder; #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using mint = modint998244353; int main() { int n; cin >> n; vector> to(n); rep(i, n-1) { int a, b; cin >> a >> b; --a; --b; to[a].push_back(b); to[b].push_back(a); } vector> dp(n); auto dfs = [&](auto f, int v, int p=-1) -> void { dp[v][0] = dp[v][1] = 1; for (int u : to[v]) { if (u == p) continue; f(f, u, v); mint x = dp[u][0], y = dp[u][1]; dp[v][1] = dp[v][0]*y + dp[v][1]*(x+y); dp[v][0] *= x+y; } }; dfs(dfs, 0); cout << dp[0][1].val() << '\n'; return 0; }