#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10, mod = 998244353;
inline int add(int a, int b) { return a + b >= mod ? a + b - mod : a + b; }
inline int sub(int a, int b) { return a >= b ? a - b : a - b + mod; }
inline int mul(int a, int b) { return 1ll * a * b % mod; }
int n, f[N][4], a[N], b[N], c[N];
vector<int> vec[N];
inline void dfs(int x, int fa) {
  for (int i = 0; i < vec[x].size(); i++)
    if (vec[x][i] != fa) dfs(vec[x][i], x);
  int cnt = 0, last = 0;
  a[cnt = last = 0] = 1;
  for (int i = 0; i < vec[x].size(); i++) {
    int y = vec[x][i];
    if (y == fa) {
      last = cnt;
      continue;
    }
    cnt++;
    a[cnt] = mul(a[cnt - 1], add(f[y][0], f[y][1]));
    b[cnt] = add(f[y][2], f[y][3]);
    c[cnt] = add(b[cnt], f[y][0]);
  }
  c[cnt + 1] = 1;
  for (int i = cnt; i >= 1; i--) c[i] = mul(c[i], c[i + 1]);
  for (int i = 1; i <= cnt; i++)
    f[x][(i > last) << 1] =
        add(f[x][(i > last) << 1], mul(a[i - 1], mul(b[i], c[i + 1])));
  f[x][1] = mul(a[last], c[last + 1]);
  f[x][3] = a[cnt];
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1, x, y; i < n; i++) {
    cin >> x >> y;
    vec[x].push_back(y);
    vec[y].push_back(x);
  }
  dfs(1, 0);
  cout << add(f[1][0], add(f[1][2], f[1][3])) << endl;
  return 0;
}
