#include <bits/stdc++.h>
using namespace std;
namespace Base {
const int inf = 0x3f3f3f3f, INF = 0x7fffffff;
const long long infll = 0x3f3f3f3f3f3f3f3fll, INFll = 0x7fffffffffffffffll;
template <typename T>
void read(T &x) {
  x = 0;
  int fh = 1;
  double num = 1.0;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') fh = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  if (ch == '.') {
    ch = getchar();
    while (isdigit(ch)) {
      num /= 10;
      x = x + num * (ch - '0');
      ch = getchar();
    }
  }
  x = x * fh;
}
template <typename T>
void chmax(T &x, T y) {
  x = x < y ? y : x;
}
template <typename T>
void chmin(T &x, T y) {
  x = x > y ? y : x;
}
}  // namespace Base
using namespace Base;
const int N = 300010, P = 998244353;
int f[N][3], g[3];
vector<int> e[N];
int n;
void dp(int x, int fa) {
  f[x][0] = 1;
  f[x][1] = 0;
  f[x][2] = 0;
  for (unsigned i = 0; i < e[x].size(); i++) {
    if (e[x][i] == fa) continue;
    int y = e[x][i];
    dp(y, x);
    g[0] = (1ll * f[x][0] * (f[y][0] + f[y][2])) % P;
    g[1] = (1ll * f[x][0] * f[y][2] + 2ll * f[x][1] * f[y][2] +
            1ll * f[x][1] * f[y][0]) %
           P;
    g[2] = (1ll * (f[x][0] + f[x][1]) * (f[y][1] + f[y][0]) % P +
            1ll * f[x][2] * (f[y][0] + 2ll * f[y][2])) %
           P;
    f[x][0] = g[0];
    f[x][1] = g[1];
    f[x][2] = g[2];
  }
}
int main() {
  read(n);
  for (int i = 1; i < n; i++) {
    int u, v;
    read(u), read(v);
    e[u].push_back(v);
    e[v].push_back(u);
  }
  dp(1, 0);
  printf("%d\n", (f[1][2] + f[1][0]) % P);
  return 0;
}
