#include <bits/stdc++.h>
using namespace std;
int n, u, v, i, cnt, head[300005], MOD = 998244353;
long long f[300005][3];
struct ff {
  int to, nxt;
} e[2 * 300005];
int fast() {
  int res = 0;
  char c = getchar();
  while (c < 48 || c > 57) c = getchar();
  while (c >= 48 && c <= 57) res = res * 10 + c - 48, c = getchar();
  return res;
}
void write(int x) {
  if (x > 9) write(x / 10);
  putchar(x % 10 + 48);
}
int add(int u, int v) {
  e[++cnt] = (ff){v, head[u]};
  head[u] = cnt;
}
long long ksm(long long x, int y) {
  long long res = 1;
  while (y) {
    if (y % 2) res = res * x % MOD;
    x = x * x % MOD, y >>= 1;
  }
  return res;
}
void dfs(int now, int fa) {
  long long num = 1, res = 1, val = 0;
  for (int i = head[now]; i; i = e[i].nxt) {
    int v = e[i].to;
    if (v == fa) continue;
    dfs(v, now);
    num = num * (f[v][0] + f[v][2]) % MOD;
    res = res * f[v][0] % MOD;
  }
  f[now][1] = num;
  for (int i = head[now]; i; i = e[i].nxt) {
    int v = e[i].to;
    if (v == fa) continue;
    val += f[v][1] * (num * ksm(f[v][0] + f[v][2], MOD - 2) % MOD) % MOD;
  }
  f[now][0] = f[now][2] = val % MOD;
  f[now][0] = (f[now][0] + res) % MOD;
}
int main() {
  n = fast();
  for (i = 1; i < n; i++) {
    u = fast(), v = fast();
    add(u, v), add(v, u);
  }
  dfs(1, 0);
  printf("%d\n", f[1][0]);
  return 0;
}
