#include <bits/stdc++.h>
using namespace std;
inline long long in() {
  long long ret = 0, c = getchar(), b = 1;
  while (!isdigit(c)) {
    b = c == '-' ? -1 : 1, c = getchar();
  }
  while (isdigit(c)) {
    ret = ret * 10 + c - '0', c = getchar();
  }
  return ret * b;
}
long long n, m, k, f[200005][4], a[200005], b[200005], c[200005];
vector<long long> e[200005];
void dfs(long long x, long long fa) {
  for (long long i = 0; i < e[x].size(); i++) {
    if (e[x][i] != fa) {
      dfs(e[x][i], x);
    }
  }
  m = 0, k = 0;
  a[0] = 1;
  for (long long i = 0; i < e[x].size(); i++) {
    if (e[x][i] == fa) {
      k = m;
    } else {
      m++;
      a[m] = (f[e[x][i]][0] + f[e[x][i]][1]) % 998244353ll * a[m - 1] %
             998244353ll;
      b[m] = (f[e[x][i]][2] + f[e[x][i]][3]) % 998244353ll;
      c[m] = (f[e[x][i]][0] + b[m]) % 998244353ll;
    }
  }
  c[m + 1] = 1;
  for (long long i = m; i; i--) {
    c[i] *= c[i + 1];
    c[i] %= 998244353ll;
  }
  for (long long i = 1; i <= m; i++) {
    f[x][(i > k) << 1] +=
        a[i - 1] * b[i] % 998244353ll * c[i + 1] % 998244353ll;
    f[x][(i > k) << 1] %= 998244353ll;
  }
  f[x][1] = a[k] * c[k + 1] % 998244353ll;
  f[x][3] = a[m];
}
signed main() {
  n = in();
  for (long long i = 1; i < n; i++) {
    long long x = in(), y = in();
    e[x].push_back(y);
    e[y].push_back(x);
  }
  dfs(1, 0);
  printf("%lld\n", (f[1][0] + f[1][2] + f[1][3]) % 998244353ll);
  return 0;
}
