#include <bits/stdc++.h>
using std::vector;
const long long mod = 998244353;
vector<int> g[300005];
long long f[300005][3];
int vis[300005];
void dp(int u) {
  vis[u] = 1;
  f[u][0] = 1, f[u][1] = 0;
  f[u][2] = 1;
  for (int v : g[u]) {
    if (!vis[v]) {
      dp(v);
      f[u][2] = f[u][2] * f[v][2] % mod;
      long long next0 = 0, next1 = 0;
      next0 += f[u][0] * f[v][2] % mod;
      next1 += f[u][1] * f[v][2] % mod;
      next0 += f[u][0] * f[v][1] % mod;
      next1 += f[u][1] * f[v][1] % mod;
      next1 += f[u][0] * f[v][0] % mod;
      next0 %= mod;
      next1 %= mod;
      f[u][0] = next0;
      f[u][1] = next1;
    }
  }
  f[u][2] = (f[u][2] + f[u][1]) % mod;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n - 1; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dp(1);
  printf("%lld\n", f[1][2]);
  return 0;
}
