#include <bits/stdc++.h>
using namespace std;
const int MXN = (int)3e5 + 7;
const int mod = 998244353;
vector<int> edge[MXN];
long long val[MXN][3];
long long mypow(long long v, long long t) {
  v %= mod;
  long long res = 1;
  while (t) {
    if (t & 1) res = res * v % mod;
    v = v * v % mod;
    t >>= 1;
  }
  return res;
}
void dfs(int u, int pa) {
  val[u][1] = 1;
  val[u][0] = 1;
  for (int v : edge[u]) {
    if (v == pa) continue;
    dfs(v, u);
    val[u][1] = val[u][1] * (val[v][0] + val[v][2]) % mod;
    val[u][0] = val[u][0] * val[v][0] % mod;
  }
  long long tmp = val[u][0];
  for (int v : edge[u]) {
    if (v == pa) continue;
    long long num = val[u][1] * mypow(val[v][0] + val[v][2], mod - 2) % mod *
                    val[v][1] % mod;
    val[u][2] = (val[u][2] + num) % mod;
    val[u][0] = (val[u][0] + num) % mod;
  }
  return;
}
int main(void) {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    edge[u].push_back(v);
    edge[v].push_back(u);
  }
  dfs(1, 0);
  printf("%lld\n", val[1][0]);
  return 0;
}
