#include <bits/stdc++.h>
using namespace std;
const int64_t MOD = 998244353;
void add(int64_t& a, int64_t b) { a = (a + b) % MOD; }
void mul(int64_t& a, int64_t b) { a = a * b % MOD; }
int64_t extgcd(int64_t a, int64_t b, int64_t& x, int64_t& y) {
  int64_t d = a;
  if (b != 0) {
    d = extgcd(b, a % b, y, x);
    y -= (a / b) * x;
  } else {
    x = 1;
    y = 0;
  }
  return d;
}
int64_t mod_inv(int64_t a) {
  int64_t x, y;
  extgcd(a, MOD, x, y);
  return (MOD + x % MOD) % MOD;
}
int N;
const int MAX = 300000;
vector<int> edges[MAX];
int64_t dp1[MAX], dp2[MAX], dp3[MAX];
void dfs(int i, int par) {
  dp1[i] = dp3[i] = 1;
  vector<int> zeros;
  for (auto j : edges[i]) {
    if (par == j) continue;
    dfs(j, i);
    mul(dp1[i], (dp1[j] + dp2[j]) % MOD);
    mul(dp3[i], (dp1[j] + 2 * dp2[j]) % MOD);
    add(dp2[i], (dp1[j] + dp3[j]) * mod_inv(dp1[j] + 2 * dp2[j]) % MOD);
  }
  mul(dp2[i], dp3[i]);
  add(dp3[i], MOD - dp1[i]);
}
int main() {
  cin >> N;
  for (int i = 0; i < N - 1; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    edges[a - 1].push_back(b - 1);
    edges[b - 1].push_back(a - 1);
  }
  dfs(0, -1);
  int64_t ans = (dp1[0] + dp2[0]) % MOD;
  cout << ans << endl;
  return 0;
}
