#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream& operator<<(ostream& os, vector<T> V) {
  os << "[ ";
  for (auto v : V) os << v << " ";
  return os << "]";
}
template <class T>
ostream& operator<<(ostream& os, set<T> S) {
  os << "{ ";
  for (auto s : S) os << s << " ";
  return os << "}";
}
template <class L, class R>
ostream& operator<<(ostream& os, pair<L, R> P) {
  return os << "(" << P.first << "," << P.second << ")";
}
template <class L, class R>
ostream& operator<<(ostream& os, map<L, R> M) {
  os << "{ ";
  for (auto m : M) os << "(" << m.F << ":" << m.S << ")";
  return os << "}";
}
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cout << name << " : " << arg1 << std::endl;
}
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 int N = 3e5 + 100;
const int mod = 998244353;
inline int mul(int a, int b) { return a * 1ll * b % mod; }
inline int add(int a, int b) {
  a += b;
  if (a >= mod) a -= mod;
  return a;
}
inline int sub(int a, int b) {
  a -= b;
  if (a < 0) a += mod;
  return a;
}
int dp[3][N];
vector<int> G[N];
void dfs(int s, int p) {
  bool leaf = 1;
  vector<int> v;
  dp[0][s] = 1;
  dp[1][s] = 0;
  dp[2][s] = 1;
  int ans = 1;
  for (auto it : G[s]) {
    if (it == p) continue;
    leaf = 0;
    dfs(it, s);
    dp[0][s] = mul(dp[0][s], add(dp[0][it], dp[1][it]));
    dp[2][s] = mul(dp[2][s], add(dp[0][it], add(dp[1][it], dp[1][it])));
    v.push_back(add(dp[1][it], add(dp[0][it], dp[1][it])));
  }
  dp[2][s] = sub(dp[2][s], dp[0][s]);
  if (leaf) {
    return;
  }
  vector<int> z = v;
  reverse((z).begin(), (z).end());
  v.insert(v.begin(), 1);
  for (int i = 1; i < v.size(); ++i) {
    v[i] = mul(v[i], v[i - 1]);
    if (i != v.size() - 1) z[i] = mul(z[i], z[i - 1]);
  }
  reverse((z).begin(), (z).end());
  z.push_back(1);
  int i = 0;
  for (auto it : G[s]) {
    if (it == p) continue;
    dp[1][s] =
        add(dp[1][s], mul(add(dp[0][it], dp[2][it]), mul(v[i], z[i + 1])));
    ++i;
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout << fixed << setprecision(25);
  int n;
  cin >> n;
  int u, v;
  for (int i = 0; i < n - 1; ++i) {
    cin >> u >> v;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  dfs(1, -1);
  cout << add(dp[0][1], dp[1][1]) << "\n";
  return 0;
}
