#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10;
const long long Mod = 998244353;
int n;
long long fpow(long long a, long long b) {
  long long res = 1;
  for (; b; b >>= 1, a = (a * a) % Mod)
    if (b & 1) res = (res * a) % Mod;
  return res;
}
struct ss {
  int to, last;
  ss() {}
  ss(int a, int b) : to(a), last(b) {}
} g[N << 1];
int head[N], cnt;
void add(int a, int b) {
  g[++cnt] = ss(b, head[a]);
  head[a] = cnt;
  g[++cnt] = ss(a, head[b]);
  head[b] = cnt;
}
long long dp[3][N];
void dfs(int a, int b) {
  long long t0 = 1, t1 = 1, t2 = 0;
  for (int i = head[a], v; i; i = g[i].last) {
    v = g[i].to;
    if (v == b) continue;
    dfs(v, a);
    t1 = t1 * ((dp[0][v] + dp[2][v]) % Mod) % Mod;
    t0 = t0 * (dp[0][v]) % Mod;
  }
  for (int i = head[a], v; i; i = g[i].last) {
    v = g[i].to;
    if (v == b) continue;
    t2 = (t2 +
          (dp[1][v] * t1 % Mod * fpow(dp[0][v] + dp[2][v], Mod - 2) % Mod)) %
         Mod;
  }
  t0 = (t0 + t2) % Mod;
  dp[0][a] = t0;
  dp[1][a] = t1;
  dp[2][a] = t2;
}
int a, b;
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &a, &b);
    add(a, b);
  }
  dfs(1, 0);
  printf("%lld\n", dp[0][1]);
  return 0;
}
