#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
std::ostream &operator<<(std::ostream &out, const std::pair<T1, T2> &rhs) {
  out << "( " << rhs.first << " , " << rhs.second << " )";
  return out;
}
template <typename A, typename B>
string to_string(pair<A, B> p);
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);
string to_string(const string &s) { return '"' + s + '"'; }
string to_string(const char *s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}
template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
         to_string(get<2>(p)) + ")";
}
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
         to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
using ll = int64_t;
using ld = long double;
const ld EPS = 1e-9;
const ll MOD = 998244353;
const ld PI = 3.141592653589793;
const int maxn = 3e5 + 1;
using pt = array<ld, 2>;
vector<int> g[maxn];
int dp[maxn][3];
ll mul(ll a, ll b) { return a * b % MOD; }
ll add(ll a, ll b) {
  a += b;
  if (a >= MOD) {
    a -= MOD;
  }
  return a;
}
void dfs(int v, int p = 1) {
  vector<int> children;
  for (int to : g[v]) {
    if (to == p) {
      continue;
    }
    children.push_back(to);
    dfs(to, v);
  }
  if (children.empty()) {
    dp[v][0] = 1;
    dp[v][1] = 1;
    dp[v][2] = 0;
    return;
  }
  int ch_size = children.size();
  children.insert(children.begin(), -1);
  vector<ll> pref(ch_size + 1);
  vector<ll> suff(ch_size + 2);
  pref[0] = 1;
  for (int i = 1; i <= ch_size; ++i) {
    pref[i] = mul(pref[i - 1], add(dp[children[i]][0], dp[children[i]][2]));
  }
  suff[ch_size + 1] = 1;
  for (int i = ch_size; i >= 1; --i) {
    suff[i] = mul(suff[i + 1], add(dp[children[i]][0], dp[children[i]][2]));
  }
  dp[v][0] = 1;
  for (int i = 1; i <= ch_size; ++i) {
    dp[v][0] = mul(dp[v][0], dp[children[i]][0]);
  }
  for (int i = 1; i <= ch_size; ++i) {
    ll to_add = mul(dp[children[i]][1], mul(pref[i - 1], suff[i + 1]));
    dp[v][0] = add(dp[v][0], to_add);
    dp[v][2] = add(dp[v][2], to_add);
  }
  dp[v][1] = pref[ch_size];
}
int main() {
  ios_base::sync_with_stdio(false);
  cout.precision(10);
  cout << fixed;
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i < n; ++i) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(1);
  for (int i = 1; i <= n; ++i) {
    42;
  }
  cout << dp[1][0];
}
