#include <bits/stdc++.h>
using namespace std;
int i, j, k, n, m;
int f[300010][3], g1[300010], g2[300010], g[300010], gg[300010], w[300010];
vector<int> a[300010];
int mul(int x, int y) {
  int res = 1ll * x * y % 998244353;
  return res;
}
int Plus(int x, int y) {
  int res = (x + y) % 998244353;
  return res;
}
void dfs(int x, int y) {
  int n_size = a[x].size();
  for (auto i : a[x]) {
    if (i == y) {
      continue;
    }
    dfs(i, x);
  }
  int ans1 = 1;
  for (auto i : a[x]) {
    if (i == y) {
      continue;
    }
    int tmp_ans1 = Plus(f[i][0], f[i][1]);
    ans1 = mul(ans1, tmp_ans1);
  }
  f[x][0] = ans1;
  ans1 = 1;
  for (auto i : a[x]) {
    if (i == y) {
      continue;
    }
    int tmp_ans1 = Plus(f[i][0], f[i][1]);
    ans1 = mul(ans1, tmp_ans1);
  }
  f[x][0] = ans1;
  int i;
  for (i = 1; i <= n_size; i++) {
    int stamp = a[x][i - 1];
    if (stamp == y) {
      g1[i] = g2[i] = 1;
      continue;
    }
    int tmp_ans1 = Plus(f[stamp][0], f[stamp][1]);
    int tmp_ans2 = Plus(tmp_ans1, f[stamp][1]);
    g1[i] = tmp_ans2;
    g2[i] = tmp_ans1;
  }
  g[0] = 1;
  for (i = 1; i <= n_size; i++) {
    g[i] = mul(g[i - 1], g1[i]);
  }
  gg[n_size + 1] = 1;
  for (i = n_size; i > 0; i--) {
    gg[i] = mul(gg[i + 1], g1[i]);
  }
  f[x][1] = 0;
  for (i = 1; i <= n_size; i++) {
    int stamp = a[x][i - 1];
    if (stamp == y) {
      continue;
    }
    int tmp_ans1 = mul(g[i - 1], gg[i + 1]);
    int tmp_ans2 = Plus(f[stamp][0], f[stamp][2]);
    int tmp_ans3 = mul(tmp_ans1, tmp_ans2);
    f[x][1] = Plus(f[x][1], tmp_ans3);
  }
  w[0] = 1;
  for (i = 1; i <= n_size; i++) {
    w[i] = mul(w[i - 1], g2[i]);
  }
  f[x][2] = 0;
  for (i = 1; i <= n_size; i++) {
    int stamp = a[x][i - 1];
    if (stamp == y) {
      continue;
    }
    int tmp_ans1 = mul(w[i - 1], gg[i + 1]);
    int tmp_ans2 = mul(tmp_ans1, f[stamp][1]);
    f[x][2] = Plus(f[x][2], tmp_ans2);
  }
}
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n - 1; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    a[x].push_back(y);
    a[y].push_back(x);
  }
  memset(f, 0, sizeof(f));
  dfs(1, 0);
  int ans = Plus(f[1][0], f[1][1]);
  printf("%d\n", ans);
  return 0;
}
