#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 9, mod = 998244353;
int n, u, v, dp1[N], dp2[N], dp3[N], dp4[N], ans[N];
vector<pair<int, int> > g[N];
void dfs(int x, int par) {
  sort(g[x].begin(), g[x].end());
  dp3[x] = 1;
  int p = 0, res = 1;
  for (int i = 0; i < g[x].size(); i++) {
    if (g[x][i].second != par) {
      dfs(g[x][i].second, x);
      dp1[x] = 1ll * dp1[x] * ans[g[x][i].second] % mod;
      dp2[x] = 1ll * dp2[x] * ans[g[x][i].second] % mod;
      if (!p) {
        dp3[x] =
            1ll * dp3[x] * (dp1[g[x][i].second] + dp3[g[x][i].second]) % mod;
        dp1[x] =
            (dp1[x] +
             1ll * res * (dp2[g[x][i].second] + dp4[g[x][i].second]) % mod) %
            mod;
      } else {
        dp3[x] = 1ll * dp3[x] * ans[g[x][i].second] % mod;
        dp2[x] =
            (dp2[x] +
             1ll * res * (dp2[g[x][i].second] + dp4[g[x][i].second]) % mod) %
            mod;
      }
      res = 1ll * res *
            ((1ll * dp1[g[x][i].second] + dp3[g[x][i].second]) % mod) % mod;
    } else
      p = 1;
  }
  dp4[x] = res;
  ans[x] = (1ll * dp1[x] + 1ll * dp2[x] + 1ll * dp4[x]) % mod;
}
int main() {
  cin >> n;
  for (int i = 1; i < n; i++) {
    cin >> u >> v;
    g[u].push_back(make_pair(i, v));
    g[v].push_back(make_pair(i, u));
  }
  dfs(1, 0);
  cout << ans[1];
}
