#include <bits/stdc++.h>
using namespace std;
template <class T, class T2>
inline int chkmax(T& x, const T2& y) {
  return x < y ? x = y, 1 : 0;
}
template <class T, class T2>
inline int chkmin(T& x, const T2& y) {
  return x > y ? x = y, 1 : 0;
}
const int MAXN = (1 << 20);
const int mod = (int)998244353;
template <class T>
T pw(T a, int pw) {
  T ret(1);
  while (pw) {
    if (pw & 1) ret *= a;
    a *= a;
    pw >>= 1;
  }
  return ret;
}
template <unsigned mod>
class Modint {
 private:
  unsigned x;

 public:
  Modint() { x = 0; }
  Modint(unsigned _x) { x = _x; }
  operator unsigned() { return x; }
  Modint operator==(const Modint& m) const { return x == m.x; }
  Modint operator!=(const Modint& m) const { return x != m.x; }
  Modint operator+=(const Modint& m) {
    x = (x + m.x >= mod ? x + m.x - mod : x + m.x);
    return *this;
  }
  Modint operator-=(const Modint& m) {
    x = (x < m.x ? x - m.x + mod : x - m.x);
    return *this;
  }
  Modint operator*=(const Modint& m) {
    x = 1ULL * x * m.x % mod;
    return *this;
  }
  Modint operator+=(const int32_t m) {
    x = (x + (m % mod) >= mod ? x + (m % mod) - mod : x + (m % mod));
    return *this;
  }
  Modint operator-=(const int32_t m) {
    x = (x < (m % mod) ? x - (m % mod) + mod : x - (m % mod));
    return *this;
  }
  Modint operator*=(const int32_t m) {
    x = 1ULL * x * (m % mod) % mod;
    return *this;
  }
  Modint operator+=(const int64_t m) {
    x = (x + (m % mod) >= mod ? x + (m % mod) - mod : x + (m % mod));
    return *this;
  }
  Modint operator-=(const int64_t m) {
    x = (x < (m % mod) ? x - (m % mod) + mod : x - (m % mod));
    return *this;
  }
  Modint operator*=(const int64_t m) {
    x = 1ULL * x * (m % mod) % mod;
    return *this;
  }
  Modint operator+(const Modint& m) const { return Modint(*this) += m; }
  Modint operator-(const Modint& m) const { return Modint(*this) -= m; }
  Modint operator*(const Modint& m) const { return Modint(*this) *= m; }
  Modint operator+(const int32_t m) const { return Modint(*this) += m; }
  Modint operator-(const int32_t m) const { return Modint(*this) -= m; }
  Modint operator*(const int32_t m) const { return Modint(*this) *= m; }
  Modint operator+(const int64_t m) const { return Modint(*this) += m; }
  Modint operator-(const int64_t m) const { return Modint(*this) -= m; }
  Modint operator*(const int64_t m) const { return Modint(*this) *= m; }
  Modint inv() { return pw(Modint(*this), mod - 2); }
};
int n;
vector<int> adj[MAXN];
void read() {
  cin >> n;
  for (int i = 0; i + 1 < n; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
}
Modint<mod> dp[MAXN][3];
void dfs(int u, int pr) {
  dp[u][0] = 0;
  dp[u][1] = 0;
  dp[u][2] = 1;
  for (int v : adj[u])
    if (v != pr) {
      dfs(v, u);
      Modint<mod> nw0 = dp[u][0] * (dp[v][1] + dp[v][2]);
      Modint<mod> nw1 = dp[u][1] * (dp[v][1] + dp[v][2]);
      Modint<mod> nw2 = dp[u][2] * (dp[v][1] + dp[v][2]);
      nw0 += (dp[u][0] + dp[u][2]) * dp[v][1];
      nw1 += (dp[v][0] + dp[v][2]) * (dp[u][0] + dp[u][2]);
      nw1 += dp[u][1] * dp[v][1];
      dp[u][0] = nw0;
      dp[u][1] = nw1;
      dp[u][2] = nw2;
    }
}
void solve() {
  dfs(1, 1);
  Modint<mod> ans = dp[1][1];
  ans += dp[1][2];
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  read();
  solve();
  return 0;
}
