#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
struct Mint {
  int val;
  Mint(long long _val) : val((_val % MOD + MOD) % MOD){};
  Mint(){};
  Mint operator+(Mint other) { return Mint(val + other.val); }
  Mint operator-(Mint other) { return Mint(val - other.val); }
  Mint operator*(Mint other) { return Mint(val * 1LL * other.val); }
  void operator+=(Mint other) {
    val += other.val;
    if (val >= MOD) val -= MOD;
  }
  void operator-=(Mint other) {
    val -= other.val;
    if (val < 0) val += MOD;
  }
  void operator*=(Mint other) { val = (val * 1LL * other.val) % MOD; }
};
const int N = (int)2e5 + 5;
vector<pair<int, int> > g[N], son[N];
vector<Mint> dp[N][2], suff[N];
Mint ans[N];
void dfs(int v, int p) {
  for (auto& [i, u] : g[v]) {
    if (u != p) {
      dfs(u, v);
      son[v].push_back({i, u});
    }
  }
  int k = (int)(son[v]).size();
  suff[v].resize(k + 1);
  suff[v][k] = 1;
  for (int i = k - 1; i >= 0; --i) {
    int u = son[v][i].second;
    suff[v][i] = suff[v][i + 1] * ans[u];
  }
  dp[v][0].resize(k + 1);
  dp[v][0][0] = Mint(1);
  dp[v][1].resize(k + 1);
  dp[v][1][0] = Mint(0);
  for (int i = 0; i < k; ++i) {
    int u = son[v][i].second;
    int pos = lower_bound((son[u]).begin(), (son[u]).end(),
                          pair<int, int>(son[v][i].first, 0)) -
              son[u].begin();
    dp[v][1][i + 1] =
        dp[v][1][i] + dp[v][0][i] * (ans[u] - dp[u][1][pos]) * suff[v][i + 1];
    dp[v][0][i + 1] =
        dp[v][0][i] * (dp[u][1][pos] + dp[u][0][pos] * suff[u][pos]);
  }
  ans[v] = dp[v][0][k] + dp[v][1][k];
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; ++i) {
    int u, v;
    scanf("%d %d", &u, &v);
    --u;
    --v;
    g[u].push_back({i, v});
    g[v].push_back({i, u});
  }
  dfs(0, -1);
  printf("%d\n", ans[0].val);
}
