#include <bits/stdc++.h>
using i64 = long long;
template <class T>
std::pair<T, T> ext_euclid(T a, T b) {
  if (b == 0) {
    return {a > 0 ? +1 : -1, 0};
  } else {
    auto res = ext_euclid(b, a % b);
    return {res.second, res.first - a / b * res.second};
  }
}
template <class T>
T mod_inv(T num, T mod) {
  assert(mod >= 0);
  num = (num % mod + mod) % mod;
  T res = ext_euclid(num, mod).first;
  return res < 0 ? res + mod : res;
}
std::vector<std::vector<int>> read_tree1(int v) {
  std::vector<std::vector<int>> graph(v);
  while (v-- > 1) {
    int x, y;
    std::cin >> x >> y;
    graph[x - 1].push_back(y - 1);
    graph[y - 1].push_back(x - 1);
  }
  return graph;
}
int main() {
  const i64 MOD = 998244353;
  int n;
  std::cin >> n;
  auto tree = read_tree1(n);
  std::function<i64(int, int)> f, g, h;
  std::map<int, i64> ff, gg, hh;
  f = [&](int cur, int prv) {
    if (ff.find(cur) != ff.end()) return ff[cur];
    i64 ans = 1;
    for (int nxt : tree[cur])
      if (nxt != prv) {
        ans = ans * f(nxt, cur) % MOD;
      }
    ans = (ans + h(cur, prv)) % MOD;
    return ff[cur] = ans;
  };
  g = [&](int cur, int prv) {
    if (gg.find(cur) != gg.end()) return gg[cur];
    i64 ans = 1;
    for (int nxt : tree[cur])
      if (nxt != prv) {
        ans = ans * (f(nxt, cur) + h(nxt, cur)) % MOD;
      }
    return gg[cur] = ans;
  };
  h = [&](int cur, int prv) {
    if (hh.find(cur) != hh.end()) return hh[cur];
    i64 prod = 1;
    for (int nxt : tree[cur])
      if (nxt != prv) {
        prod = prod * (f(nxt, cur) + h(nxt, cur)) % MOD;
      }
    i64 ans = 0;
    for (int nxt : tree[cur])
      if (nxt != prv) {
        ans = (ans + g(nxt, cur) * prod % MOD *
                         mod_inv(f(nxt, cur) + h(nxt, cur), MOD)) %
              MOD;
      }
    return hh[cur] = ans;
  };
  std::cout << f(0, -1) << std::endl;
}
