#include <bits/stdc++.h>
using namespace std;
class Tree {
 public:
  int n, *dp[3], *par;
  vector<int> *V;
  Tree(int n);
  void addEdge(int u, int v);
  int Dp(int nod);
};
Tree::Tree(int n) {
  this->n = n;
  par = new int[n + 1];
  par[0] = 0;
  for (int i = 1; i < n; ++i) par[i] = -1;
  for (int t = 0; t < 3; ++t) dp[t] = new int[n + 1];
  V = new vector<int>[n + 1];
}
void Tree::addEdge(int u, int v) {
  --u;
  --v;
  V[u].push_back(v);
  V[v].push_back(u);
}
int invMod(int x) {
  int ret = 1, p = 998244353 - 2;
  x %= 998244353;
  for (int i = 0; (1 << i) <= p; ++i, x = (1LL * x * x) % 998244353)
    if (p & (1 << i)) ret = (1LL * ret * x) % 998244353;
  return ret;
}
int Tree::Dp(int nod) {
  dp[0][nod] = 1;
  dp[1][nod] = 1;
  dp[2][nod] = 0;
  bool leaf = 1;
  for (int son : V[nod])
    if (par[son] == -1) {
      par[son] = nod;
      Dp(son);
      leaf = 0;
      dp[1][nod] = (1LL * dp[1][nod] * (dp[0][son] + dp[2][son])) % 998244353;
      dp[0][nod] = (1LL * dp[0][nod] * dp[0][son]) % 998244353;
    }
  for (int son : V[nod])
    if (par[son] == nod) {
      int prod =
          (1LL * dp[1][nod] * invMod(dp[0][son] + dp[2][son])) % 998244353;
      dp[2][nod] = (1LL * dp[1][son] * prod + dp[2][nod]) % 998244353;
    }
  if (!leaf) dp[0][nod] += dp[2][nod];
  if (dp[0][nod] >= 998244353) dp[0][nod] -= 998244353;
  return dp[0][nod];
}
int main() {
  int n;
  scanf("%d", &n);
  Tree T(n);
  for (int i = 1; i < n; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    T.addEdge(u, v);
  }
  printf("%d\n", T.Dp(0));
  return 0;
}
