#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops")
using namespace std;
const long long maxn = 3e5 + 10;
const long long INF = 1e18;
long long n, mod = 998244353, dp1[maxn], dp2[maxn], dp[maxn], per[maxn],
             suf[maxn];
vector<long long> g[maxn];
void dfs(long long v, long long p) {
  vector<long long> ch;
  dp2[v] = dp[v] = 1;
  for (auto u : g[v]) {
    if (u != p) {
      dfs(u, v);
      dp2[v] = (dp2[v] * (dp1[u] + dp[u])) % mod;
      ch.push_back(u);
    }
  }
  if (!ch.size()) return;
  per[-1] = 1;
  for (int i = 0; i < ch.size(); i++)
    per[i] = (per[i - 1] * (dp1[ch[i]] + dp[ch[i]])) % mod;
  suf[ch.size()] = 1;
  for (int i = ch.size() - 1; i >= 0; i--)
    suf[i] = (suf[i + 1] * (dp1[ch[i]] + dp[ch[i]])) % mod;
  long long anss = 0;
  for (int i = 0; i < ch.size(); i++)
    anss =
        (anss + (((per[i - 1] * suf[i + 1]) % mod) * dp2[ch[i]]) % mod) % mod;
  dp1[v] = anss % mod;
  anss = 1;
  for (auto u : ch) anss = (anss * dp[u]) % mod;
  dp[v] = (anss + dp1[v]) % mod;
}
long long poww(long long a, long long b) {
  if (b == 0) return 1;
  long long x = poww(a, b / 2) % mod;
  if (b & 1)
    return (((x * x) % mod) * a) % mod;
  else
    return (x * x) % mod;
}
int main() {
  std::ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i < n; i++) {
    long long v, u;
    cin >> v >> u;
    g[v].push_back(u);
    g[u].push_back(v);
  }
  dfs(1, 0);
  cout << dp[1] % mod;
  return 0;
}
