#include <bits/stdc++.h>
const int N = 3e5 + 5, mod = 998244353;
int n, nxt[N << 1], to[N << 1], head[N], f[N][3], cnt;
int read() {
  int x = 0, f = 1;
  char s;
  while ((s = getchar()) > '9' || s < '0')
    if (s == '-') f = -1;
  while (s >= '0' && s <= '9')
    x = (x << 1) + (x << 3) + (s ^ 48), s = getchar();
  return x * f;
}
void addEdge(const int u, const int v) {
  nxt[++cnt] = head[u], to[cnt] = v, head[u] = cnt;
}
int inv(int x, int y) {
  int r = 1;
  while (y) {
    if (y & 1) r = 1ll * r * x % mod;
    x = 1ll * x * x % mod;
    y >>= 1;
  }
  return r;
}
void DP(const int u, const int fa) {
  f[u][0] = 0;
  f[u][1] = f[u][2] = 1;
  int tmp = 1;
  for (int i = head[u]; i; i = nxt[i])
    if (to[i] ^ fa) {
      DP(to[i], u);
      f[u][2] = 1ll * f[u][2] * (f[to[i]][0] + f[to[i]][2]) % mod;
      f[u][1] = 1ll * f[u][1] * (f[to[i]][0] * 2 % mod + f[to[i]][2]) % mod;
      tmp = 1ll * tmp * (f[to[i]][0] * 2 % mod + f[to[i]][2]) % mod;
    }
  f[u][1] = (f[u][1] - f[u][2] + mod) % mod;
  for (int i = head[u]; i; i = nxt[i])
    if (to[i] ^ fa)
      f[u][0] = (f[u][0] +
                 1ll * tmp *
                     inv((f[to[i]][0] * 2 % mod + f[to[i]][2]) % mod, mod - 2) %
                     mod * (f[to[i]][1] + f[to[i]][2]) % mod) %
                mod;
}
int main() {
  int u, v;
  n = read();
  for (int i = 1; i < n; ++i) {
    u = read(), v = read();
    addEdge(u, v), addEdge(v, u);
  }
  DP(1, 0);
  printf("%d\n", (f[1][0] + f[1][2]) % mod);
  return 0;
}
