#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cout << name << " : " << arg1 << "\n";
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const long long N = 3e5 + 5, p = 998244353;
long long n, noRoot[N], withParent[N], dp[N], ans;
vector<long long> adj[N];
void dfs(long long v, long long pv) {
  noRoot[v] = 1;
  withParent[v] = 1;
  for (auto ch : adj[v]) {
    if (ch == pv) continue;
    dfs(ch, v);
    noRoot[v] = (noRoot[v] * (noRoot[ch] + dp[ch])) % p;
    long long z = (noRoot[ch] + 2 * dp[ch]) % p;
    withParent[v] = (withParent[v] * z) % p;
  }
  vector<long long> pref, suff;
  long long prv = 1;
  for (auto ch : adj[v]) {
    if (ch != pv) {
      long long z = (noRoot[ch] + 2 * dp[ch]) % p;
      prv = (prv * z) % p;
    }
    pref.push_back(prv);
  }
  prv = 1;
  for (long long i = (long long)adj[v].size() - 1; i >= 0; i--) {
    long long ch = adj[v][i];
    if (ch != pv) {
      long long z = (noRoot[ch] + 2 * dp[ch]) % p;
      prv = (prv * z) % p;
    }
    suff.push_back(prv);
  }
  reverse(suff.begin(), suff.end());
  long long res = 0;
  for (long long i = 0; i < (long long)adj[v].size(); i++) {
    long long ch = adj[v][i];
    if (ch == pv) continue;
    long long temp = withParent[ch];
    if (i > 0) temp = (temp * pref[i - 1]) % p;
    if (i < (long long)adj[v].size() - 1) temp = (temp * suff[i + 1]) % p;
    res = (res + temp) % p;
  }
  dp[v] = res;
}
void solveTask() {
  cin >> n;
  for (long long i = 1; i < n; i++) {
    long long u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(1, 0);
  ans = (dp[1] + noRoot[1]) % p;
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(NULL);
  long long t = 1;
  while (t--) {
    solveTask();
  }
  return 0;
}
