#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7, mod = 998244353;
int n;
int a[N], b[N];
vector<int> adj[N];
long long dp[N][3];
void add(long long &y, long long x) {
  y += x;
  if (y >= mod) y -= mod;
}
void dfs(int v, int pe) {
  for (int e : adj[v])
    if (e != pe) dfs(a[e] ^ b[e] ^ v, e);
  vector<pair<int, int>> vp;
  for (int e : adj[v])
    if (e != pe) vp.push_back({e, a[e] ^ b[e] ^ v});
  int m = vp.size();
  if (m) {
    sort(begin(vp), end(vp));
    vector<int> pre(m), post(m);
    for (int i = 0; i < m; i++) {
      pre[i] = dp[vp[i].second][2];
      post[i] = dp[vp[i].second][0];
      if (i) pre[i] = 1LL * pre[i - 1] * pre[i] % mod;
    }
    for (int i = m - 2; i >= 0; i--)
      post[i] = 1LL * post[i + 1] * post[i] % mod;
    dp[v][0] = pre[m - 1];
    for (int i = 0; i < m; i++) {
      int e = vp[i].first, w = vp[i].second;
      long long pull = dp[w][1] * (i ? pre[i - 1] : 1) % mod *
                       (i + 1 < m ? post[i + 1] : 1) % mod;
      add(dp[v][0], pull);
      if (pe != -1 && e < pe) add(dp[v][2], pull);
      if (pe != -1 && e > pe) add(dp[v][1], pull);
    }
    if (pe != -1) {
      int i = 0;
      while (i < m && vp[i].first < pe) i++;
      long long nanb =
          1LL * (i >= 1 ? pre[i - 1] : 1) * (i < m ? post[i] : 1) % mod;
      add(dp[v][1], pre[m - 1]);
      add(dp[v][2], nanb);
    }
  } else {
    dp[v][0] = 1;
    dp[v][1] = 1;
    dp[v][2] = 1;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    cin >> a[i] >> b[i];
    adj[--a[i]].push_back(i);
    adj[--b[i]].push_back(i);
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < 3; j++) dp[i][j] = 0;
  dfs(0, -1);
  cout << dp[0][0] << endl;
  return 0;
}
