#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 3) + (x << 1) + (c ^ 48);
    c = getchar();
  }
  return f == 1 ? x : -x;
}
inline void print(long long x) {
  if (x < 0) x = ~x + 1, putchar('-');
  if (x >= 10) print(x / 10);
  putchar((x % 10) | 48);
}
long long n;
vector<long long> vec[300010];
const long long mod = 998244353;
long long dp[300010][3];
long long qpow(long long x, long long k) {
  long long res = 1;
  while (k) {
    if (k & 1) res = 1ll * res * x % mod;
    x = 1ll * x * x % mod;
    k >>= 1;
  }
  return res;
}
void dfs(long long x, long long f) {
  dp[x][0] = 1;
  long long sum = 0ll;
  for (long long v : vec[x]) {
    if (v == f) continue;
    dfs(v, x);
    dp[x][1] = (1ll * dp[x][1] * (dp[v][0] + dp[v][1] * 2ll) % mod +
                1ll * (dp[x][0] + dp[x][2]) * (dp[v][0] + dp[v][2]) % mod) %
               mod;
    dp[x][2] = 1ll * dp[x][2] * (dp[v][0] + dp[v][1] * 2ll) % mod +
               1ll * dp[x][0] * dp[v][1] % mod;
    dp[x][0] = 1ll * dp[x][0] * (dp[v][0] + dp[v][1]) % mod;
  }
}
signed main() {
  n = read();
  for (long long i = 1; i < n; ++i) {
    long long u = read(), v = read();
    vec[u].push_back(v);
    vec[v].push_back(u);
  }
  dfs(1, 0);
  printf("%lld\n", (dp[1][0] + dp[1][1]) % mod);
  return 0;
}
