#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
struct custom_hash {
  static uint64_t splitmix64(uint64_t x) {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};
const long long int MAXN = 3e5 + 15, md = 998244353, inf = 1e15;
unordered_map<long long int, long long int, custom_hash> t;
long long int tav(long long int n, long long int k) {
  long long int res = 1;
  while (k > 0) {
    if (k & 1) {
      res *= n;
      res %= md;
    }
    n *= n;
    n %= md;
    k /= 2;
  }
  return res;
}
long long int dv(long long int a, long long int b) {
  a %= md;
  b %= md;
  if (!t.count(b)) {
    t[b] = tav(b, md - 2);
  }
  long long int res = 1ll * a * t[b] % md;
  return res;
}
vector<long long int> adj[MAXN];
long long int dp[MAXN][3];
void DFS(long long int r, long long int par) {
  for (auto i : adj[r]) {
    if (i == par) continue;
    DFS(i, r);
  }
  dp[r][0] = 1;
  for (auto i : adj[r]) {
    if (i == par) continue;
    dp[r][0] *= dp[i][0] + dp[i][1];
    dp[r][0] %= md;
  }
  dp[r][2] = 1;
  for (auto i : adj[r]) {
    if (i == par) continue;
    dp[r][2] *= dp[i][0] + 2 * dp[i][1];
    dp[r][2] %= md;
  }
  dp[r][1] = 0;
  for (auto i : adj[r]) {
    if (i == par) continue;
    long long int h = dv(dp[r][2], dp[i][0] + 2 * dp[i][1]) * dp[i][2] % md;
    dp[r][1] += h;
  }
  dp[r][1] %= md;
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  for (long long int i = 1; i < n; i++) {
    long long int v, u;
    cin >> v >> u;
    v--;
    u--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  DFS(0, -1);
  cout << (dp[0][0] + dp[0][1]) % md << '\n';
  return 0;
}
