#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
int n, h[N], nxt[N], adj[N], u, v, t, a[N], b[N], c[N], f[N][4], fa[N];
vector<int> g[N];
inline int mo(const int x) { return x >= 998244353 ? x - 998244353 : x; }
inline void dfs(const int x) {
  for (const int &j : g[x])
    if (j ^ fa[x]) fa[j] = x, dfs(j);
  register int cn = 0, id = 0;
  a[0] = 1;
  for (const int &j : g[x])
    if (j == fa[x])
      id = cn;
    else
      ++cn, a[cn] = (0ll + a[cn - 1]) * (f[j][0] + f[j][1]) % 998244353,
            b[cn] = mo(f[j][2] + f[j][3]), c[cn] = mo(f[j][0] + b[cn]);
  c[cn + 1] = 1;
  for (register int i = cn; i; --i) c[i] = (0ll + c[i]) * c[i + 1] % 998244353;
  for (register int i = 1, j; i <= cn; ++i)
    j = (i > id) << 1,
    f[x][j] =
        (f[x][j] + (0ll + a[i - 1]) * b[i] % 998244353 * c[i + 1]) % 998244353;
  f[x][1] = (0ll + a[id]) * c[id + 1] % 998244353, f[x][3] = a[cn];
}
int main() {
  scanf("%d", &n);
  register int i;
  for (i = 1; i < n; ++i)
    scanf("%d%d", &u, &v), g[u].push_back(v), g[v].push_back(u);
  dfs(1), printf("%d", (0ll + f[1][0] + f[1][2] + f[1][3]) % 998244353);
  return 0;
}
