#include <bits/stdc++.h>
long long get() {
  long long x = 0;
  char s = getchar();
  while (s < '0' || s > '9') s = getchar();
  while (s >= '0' && s <= '9')
    x = (x << 3) + (x << 1) + (s ^ 48), s = getchar();
  return x;
}
const long long M = 3e5 + 5, mo = 998244353;
long long n, head[M], cntedge, f[M][3], g[3];
struct edge {
  long long to, nxt;
  edge() {}
  edge(const long long T, const long long NX) { to = T, nxt = NX; }
} e[M << 1];
void add(const long long u, const long long v) {
  e[++cntedge] = edge(v, head[u]), head[u] = cntedge;
}
void update(const long long x) {
  for (long long i = 0; i < 3; ++i) f[x][i] = g[i];
}
void dfs(const long long x, const long long fa) {
  f[x][0] = 1;
  for (long long i = head[x], v; i; i = e[i].nxt) {
    if ((v = e[i].to) == fa) continue;
    dfs(v, x);
    g[0] = f[x][0] * (f[v][0] + f[v][2]) % mo;
    g[1] =
        (f[x][0] * f[v][2] % mo + f[x][1] * (f[v][0] + f[v][2] * 2 % mo) % mo) %
        mo;
    g[2] = (f[x][0] * (f[v][0] + f[v][1]) % mo +
            f[x][1] * (f[v][0] + f[v][1]) % mo +
            f[x][2] * (f[v][0] + f[v][2] * 2 % mo) % mo) %
           mo;
    update(x);
  }
}
signed main() {
  n = get();
  for (long long i = 1, u, v; i < n; ++i) {
    u = get(), v = get();
    add(u, v), add(v, u);
  }
  dfs(1, 0);
  printf("%lld", (f[1][0] + f[1][2]) % mo);
  return 0;
}
