#include <bits/stdc++.h>
using namespace std;
const int M = 300005;
const int MOD = 998244353;
long long read() {
  long long x = 0, f = 1;
  char c;
  while ((c = getchar()) < '0' || c > '9') {
    if (c == '-') f = -1;
  }
  while (c >= '0' && c <= '9') {
    x = (x << 3) + (x << 1) + (c ^ 48);
    c = getchar();
  }
  return x * f;
}
long long n, tot, f[M], dp[M][3], g[3];
struct edge {
  long long v, next;
} e[2 * M];
void dfs(long long u, long long fa) {
  dp[u][0] = 1;
  for (long long i = f[u]; i; i = e[i].next) {
    long long v = e[i].v;
    if (v == fa) continue;
    dfs(v, u);
    g[0] = dp[u][0] * (dp[v][0] + dp[v][2]) % MOD;
    g[1] = (dp[u][0] * dp[v][2] + dp[u][1] * (dp[v][0] + 2 * dp[v][2]) % MOD) %
           MOD;
    g[2] = (dp[u][0] * (dp[v][0] + dp[v][1]) % MOD +
            dp[u][1] * (dp[v][0] + dp[v][1]) % MOD +
            dp[u][2] * (dp[v][0] + dp[v][2] * 2) % MOD) %
           MOD;
    swap(dp[u], g);
  }
}
signed main() {
  n = read();
  for (long long i = 1; i < n; i++) {
    long long u = read(), v = read();
    e[++tot] = edge{v, f[u]}, f[u] = tot;
    e[++tot] = edge{u, f[v]}, f[v] = tot;
  }
  dfs(1, 0);
  printf("%lld\n", (dp[1][0] + dp[1][2]) % MOD);
}
