#include <bits/stdc++.h>
using namespace std;
template <typename num_t>
inline void addmod(num_t& a, const long long& b, const int& m) {
  a = (a + b) % m;
  if (a < 0) a += m;
}
template <typename num_t>
inline void update_max(num_t& a, const num_t& b) {
  a = max(a, b);
}
template <typename num_t>
inline void update_min(num_t& a, const num_t& b) {
  a = min(a, b);
}
template <typename num_t>
num_t gcd(num_t lhs, num_t rhs) {
  return !lhs ? rhs : gcd(rhs % lhs, lhs);
}
template <typename num_t>
num_t pw(num_t n, num_t k, num_t mod) {
  long long res = 1;
  for (; k; k >>= 1) {
    if (k & 1) res = res * n % mod;
    n = 1ll * n * n % mod;
  }
  return (num_t)res;
}
const int inf = 1e9 + 7;
const long long ll_inf = 1ll * inf * inf;
const int MAX_N = 300000 + 7;
const int mod = 998244353;
int n;
vector<int> adj[MAX_N];
long long even[MAX_N];
long long odd[MAX_N][2];
void dfs(int u, int r) {
  for (int v : adj[u])
    if (v != r) {
      dfs(v, u);
    }
  static long long temp[2][2];
  for (int p = (0), _b = (2); p < _b; ++p)
    for (int q = (0), _b = (2); q < _b; ++q) temp[p][q] = 0;
  temp[0][0] = 1;
  temp[0][1] = 1;
  for (int v : adj[u])
    if (v != r) {
      long long cur[2][2];
      cur[0][0] = temp[0][0] * (even[v] + odd[v][0]) % mod;
      cur[0][1] = temp[0][1] * (even[v] * 2 + odd[v][0]) % mod;
      cur[1][0] = (temp[1][0] * (even[v] * 2 + odd[v][0]) +
                   temp[0][1] * (odd[v][0] + odd[v][1])) %
                  mod;
      for (int p = (0), _b = (2); p < _b; ++p)
        for (int q = (0), _b = (2); q < _b; ++q) temp[p][q] = cur[p][q];
    }
  even[u] = temp[1][0];
  odd[u][0] = temp[0][0];
  odd[u][1] = temp[0][1];
  addmod(odd[u][1], -odd[u][0], mod);
}
void solve() {
  cin >> n;
  for (int i = 1; i < n; ++i) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(1, -1);
  int u = 1;
  cout << (even[u] + odd[u][0]) % mod;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  const bool multiple_test = false;
  int test = 1;
  if (multiple_test) cin >> test;
  for (int i = 0; i < test; ++i) {
    solve();
  }
}
