#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
int add(int a, int b) { return (a + b) % MOD; }
int mul(int a, int b) { return ((long long)a * b) % MOD; }
const int MAXN = 2e5 + 10;
vector<pair<int, int> > e[MAXN];
int dp[MAXN][3];
void dfs(int i, int p) {
  for (auto q : e[i])
    if (q.second != p) dfs(q.second, i);
  int n = e[i].size();
  sort(e[i].begin(), e[i].end());
  vector<int> pref(n + 1), suff(n + 1);
  for (int k = 0; k < n + 1; k++) {
    if (k == 0 || e[i][k - 1].second == p)
      pref[k] = 1;
    else
      pref[k] = dp[e[i][k - 1].second][0];
    if (k > 0) pref[k] = mul(pref[k], pref[k - 1]);
  }
  for (int k = n; k >= 0; k--) {
    if (k >= n - 1 || e[i][k + 1].second == p)
      suff[k] = 1;
    else
      suff[k] = dp[e[i][k + 1].second][2];
    if (k < n - 1) suff[k] = mul(suff[k], suff[k + 1]);
  }
  bool after_parent = false;
  for (int k = 0; k < n + 1; k++) {
    int t = mul(pref[k], suff[k]);
    if (k < n && e[i][k].second == p) {
      dp[i][0] = add(dp[i][0], t);
      after_parent = true;
    } else {
      if (k < n) t = mul(t, dp[e[i][k].second][1]);
      dp[i][2] = add(dp[i][2], t);
      if (after_parent)
        dp[i][1] = add(dp[i][1], t);
      else
        dp[i][0] = add(dp[i][0], t);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    e[x].push_back({i, y});
    e[y].push_back({i, x});
  }
  dfs(0, -1);
  cout << dp[0][2];
  return 0;
}
