#include <bits/stdc++.h>
using i64 = long long;
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;
}
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) {
  num = (num % mod + mod) % mod;
  T res = ext_euclid(num, mod).first;
  return res < 0 ? res + mod : res;
}
int main() {
  std::ios::sync_with_stdio(0), std::cin.tie(0), std::cout.tie(0);
  const i64 MOD = 998244353;
  int n;
  std::cin >> n;
  auto tree = read_tree1(n);
  std::function<std::tuple<i64, i64, i64>(int, int)> dfs =
      [&](int cur, int prv) -> std::tuple<i64, i64, i64> {
    std::vector<std::tuple<i64, i64, i64>> nxts;
    for (int nxt : tree[cur])
      if (nxt != prv) {
        nxts.push_back(dfs(nxt, cur));
      }
    i64 prod = 1;
    for (const auto& [f, g, h] : nxts) {
      prod = prod * (f + h) % MOD;
    }
    i64 F = 1, G = 1, H = 0;
    for (const auto& [f, g, h] : nxts) {
      F = F * f % MOD;
      G = G * (f + h) % MOD;
      H = (H + g * mod_inv(f + h, MOD)) % MOD;
    }
    H = H * prod % MOD;
    F = (F + H) % MOD;
    return {F, G, H};
  };
  std::cout << std::get<0>(dfs(0, -1)) << '\n';
}
