#include <bits/stdc++.h>
using namespace std;
struct node {
  long long to, next;
} e[300005 << 1];
long long head[300005], cnt, f[300005][3], n;
void add(long long x, long long y) {
  e[cnt] = (node){y, head[x]};
  head[x] = cnt++;
}
long long q_pow(long long x, long long n) {
  long long ret = 1;
  for (; n; n >>= 1, x = (long long)x * x % 998244353)
    if (n & 1) ret = (long long)ret * x % 998244353;
  return ret;
}
void dfs(long long x, long long from) {
  f[x][2] = f[x][1] = 1;
  long long tmp = 1;
  for (long long i = head[x]; i != -1; i = e[i].next) {
    long long to1 = e[i].to;
    if (to1 != from) {
      dfs(to1, x);
      f[x][1] = (long long)f[x][1] *
                ((f[to1][0] + f[to1][0]) % 998244353 + f[to1][2]) % 998244353;
      f[x][2] = (long long)f[x][2] * (f[to1][0] + f[to1][2]) % 998244353;
      tmp = (long long)tmp * ((f[to1][0] + f[to1][0]) % 998244353 + f[to1][2]) %
            998244353;
    }
  }
  for (long long i = head[x]; i != -1; i = e[i].next) {
    long long to1 = e[i].to;
    if (to1 != from)
      f[x][0] =
          (f[x][0] + (long long)tmp *
                         q_pow((f[to1][0] + f[to1][0]) % 998244353 + f[to1][2],
                               998244353 - 2) %
                         998244353 * f[to1][1]) %
          998244353;
  }
}
signed main() {
  scanf("%lld", &n);
  memset(head, -1, sizeof(head));
  for (long long i = 1, x, y; i < n; i++)
    scanf("%lld%lld", &x, &y), add(x, y), add(y, x);
  dfs(1, 0);
  printf("%lld\n", (f[1][0] + f[1][2]) % 998244353);
}
