#include <bits/stdc++.h>
using namespace std;
inline void read(long long &x) {
  char ch;
  bool flag = false;
  for (ch = getchar(); !isdigit(ch); ch = getchar())
    if (ch == '-') flag = true;
  for (x = 0; isdigit(ch); x = x * 10 + ch - '0', ch = getchar())
    ;
  x = flag ? -x : x;
}
inline void read(int &x) {
  char ch;
  bool flag = false;
  for (ch = getchar(); !isdigit(ch); ch = getchar())
    if (ch == '-') flag = true;
  for (x = 0; isdigit(ch); x = x * 10 + ch - '0', ch = getchar())
    ;
  x = flag ? -x : x;
}
inline void write(long long x) {
  static const long long maxlen = 100;
  static char s[maxlen];
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (!x) {
    putchar('0');
    return;
  }
  long long len = 0;
  for (; x; x /= 10) s[len++] = x % 10 + '0';
  for (long long i = len - 1; i >= 0; --i) putchar(s[i]);
}
template <typename T>
T gcd(T m, T n) {
  if (!m || !n) return m | n;
  if (m < 0) m = -m;
  if (n < 0) n = -n;
  long long p = 0;
  while (!(m & 1) && !(n & 1)) m >>= 1, n >>= 1, ++p;
  while (n) {
    while (!(m & 1)) m >>= 1;
    while (!(n & 1)) n >>= 1;
    if (m >= n) std::swap(m, n);
    n = (n - m) >> 1;
  }
  return m << p;
}
template <typename T>
std::pair<T, std::pair<T, T> > exgcd(T m, T n) {
  using std::make_pair;
  T x = 0, y = 1, xp = 1, yp = 0, xt, yt;
  for (T r = m % n, q = m / n; r;) {
    xt = xp - q * x, xp = x, x = xt;
    yt = yp - q * y, yp = y, y = yt;
    m = n, n = r, r = m % n, q = m / n;
  }
  return make_pair(n, make_pair(x, y));
}
template <typename T>
T modinv(T m, T n) {
  std::pair<T, std::pair<T, T> > gxy = exgcd(m, n);
  T loop = n / gxy.first;
  T inv = gxy.second.first;
  inv = inv % loop;
  return inv < 0 ? inv + loop : inv;
}
const long long MAXN = 301000;
const long long P = 998244353;
long long n;
vector<long long> son[MAXN];
long long f[MAXN][3];
void dfs(long long x, long long fa) {
  f[x][1] = 1;
  f[x][2] = 0;
  long long T = 1;
  for (long long i = 0; i < son[x].size(); i++)
    if (son[x][i] != fa) {
      long long y = son[x][i];
      dfs(y, x);
      T = T * f[y][0] % P;
      f[x][1] = f[x][1] * (f[y][0] + f[y][2]) % P;
    }
  for (long long i = 0; i < son[x].size(); i++)
    if (son[x][i] != fa) {
      long long y = son[x][i];
      f[x][2] =
          (f[x][2] + modinv(f[y][0] + f[y][2], P) * f[y][1] % P * f[x][1] % P) %
          P;
    }
  f[x][0] = (T + f[x][2]) % P;
}
int main() {
  read(n);
  for (long long i = 1; i < n; i++) {
    long long a, b;
    read(a);
    read(b);
    son[a].push_back(b);
    son[b].push_back(a);
  }
  dfs(1, 0);
  printf("%I64d\n", f[1][0] % P);
  return 0;
}
