#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353, maxn = 300100;
inline int ksm(int a, int b) {
  int res = 1;
  for (; b; b >>= 1, a = 1ll * a * a % mod)
    if (b & 1) res = 1ll * res * a % mod;
  return res;
}
int head[maxn], nxt[maxn << 1], ver[maxn << 1], tot;
inline void addedge(int a, int b) {
  nxt[++tot] = head[a];
  ver[tot] = b;
  head[a] = tot;
  nxt[++tot] = head[b];
  ver[tot] = a;
  head[b] = tot;
}
int f[maxn][3], n;
inline void treedp(int x, int fat) {
  int mul02 = 1, mul0 = 1;
  for (int i = head[x]; i; i = nxt[i]) {
    int y = ver[i];
    if (y == fat) continue;
    treedp(y, x);
    mul02 = 1ll * (f[y][0] + f[y][2]) % mod * mul02 % mod;
    mul0 = 1ll * mul0 * f[y][0] % mod;
  }
  f[x][1] = mul02;
  f[x][0] = mul0;
  int get = 0;
  for (int i = head[x]; i; i = nxt[i]) {
    int y = ver[i];
    if (y == fat) continue;
    int v = (f[y][0] + f[y][2]) % mod;
    (get += 1ll * f[y][1] * mul02 % mod * ksm(v, mod - 2) % mod) %= mod;
  }
  f[x][2] = get;
  (f[x][0] += get) %= mod;
}
int main() {
  scanf("%d", &n);
  for (int i = 1, a, b; i < n; i++) scanf("%d%d", &a, &b), addedge(a, b);
  treedp(1, 0);
  printf("%d", f[1][0]);
  return 0;
}
