#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 3e5 + 7;
long long n;
vector<long long> g[MAXN];
void read() {
  cin >> n;
  for (long long i = 0; i < n - 1; ++i) {
    long long u, v;
    cin >> u >> v;
    --u;
    --v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
}
const long long MOD = 998244353;
long long mod(long long n) { return (n % MOD + MOD) % MOD; }
long long dp[MAXN][3];
long long fp(long long a, long long b) {
  if (b == 0) return 1;
  long long t = fp(a, b >> 1);
  if (b & 1)
    return mod(mod(t * t) * a);
  else
    return mod(t * t);
}
long long mdiv(long long a, long long b) { return mod(a * fp(b, MOD - 2)); }
void calc(long long u, long long parent) {
  long long cnt = 0;
  for (long long v : g[u]) {
    if (v == parent) continue;
    ++cnt;
  }
  if (!cnt) {
    dp[u][0] = 0;
    dp[u][1] = 0;
    dp[u][2] = 1;
    return;
  }
  long long sum = 1;
  for (long long v : g[u]) {
    if (v == parent) continue;
    sum = mod(sum * (dp[v][0] * 2 + dp[v][2]));
  }
  for (long long v : g[u]) {
    if (v == parent) continue;
    long long t = mdiv(sum, dp[v][0] * 2 + dp[v][2]);
    dp[u][0] = mod(dp[u][0] + dp[v][1] * t);
    dp[u][0] = mod(dp[u][0] + dp[v][2] * t);
  }
  dp[u][1] = 1;
  for (long long v : g[u]) {
    if (v == parent) continue;
    dp[u][1] = mod(dp[u][1] * (dp[v][0] * 2 + dp[v][2]));
  }
  dp[u][2] = 1;
  for (long long v : g[u]) {
    if (v == parent) continue;
    dp[u][2] = mod(dp[u][2] * (dp[v][0] + dp[v][2]));
  }
  dp[u][1] = mod(dp[u][1] - dp[u][2]);
}
void dfs(long long u, long long parent) {
  for (long long v : g[u]) {
    if (v == parent) continue;
    dfs(v, u);
  }
  calc(u, parent);
}
void solve() { dfs(0, 0); }
void print() { cout << mod(dp[0][0] + dp[0][2]) << '\n'; }
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  read();
  solve();
  print();
  return 0;
}
