#include using namespace std; using ll = long long; int main(){ ios::sync_with_stdio(false); cin.tie(0); int n, u, v; cin >> n; vector> g(n); for(int i = 1; i < n; i++){ cin >> u >> v; g[--u].emplace_back(--v); g[v].emplace_back(u); } vector> dp(n, {0, 0, 0}); function dfs = [&](int v, int p){ vector> a; for(auto &&u:g[v]){ if(u == p)continue; dfs(u, v); a.push_back({dp[u][0], dp[u][1], dp[u][2]}); } int c = a.size(); dp[v][0] = 1; for(int i = 0; i < c; i++){ array ndp{}; for(int j = 0; j < 3; j++){ if(j < 2)(ndp[j + 1] += dp[v][j] * (a[i][0] + a[i][1])) %= 998244353; (ndp[j] += dp[v][j] * (a[i][1] + a[i][2])) %= 998244353; } swap(dp[v], ndp); } }; dfs(0, -1); cout << (dp[0][1] + dp[0][2]) % 998244353 << '\n'; }