#include <bits/stdc++.h>
using namespace std;
const long long N = 550005;
const long long mod = 998244353;
int n, u, v;
vector<int> g[N];
long long dp[N][2][2];
inline long long bin(long long x, long long k) {
  long long res = 1;
  while (k) {
    if (k & 1) res = res * x % mod;
    x = x * x % mod;
    k >>= 1;
  }
  return res;
}
vector<long long> pre, su;
inline void dfs(int v, int p = 0) {
  for (int i = 0; i < g[v].size(); ++i) {
    int to = g[v][i];
    if (to == p) {
      swap(g[v][i], g[v].back());
      g[v].pop_back();
      break;
    }
  }
  for (int to : g[v]) {
    dfs(to, v);
  }
  int sz = g[v].size();
  pre.resize(sz, 0);
  su.resize(sz, 0);
  for (int i = 0; i < sz; ++i) {
    int to = g[v][i];
    pre[i] = (dp[to][1][0] + dp[to][0][0]) % mod;
    if (i) pre[i] = pre[i - 1] * pre[i] % mod;
  }
  for (int i = sz - 1; i >= 0; --i) {
    int to = g[v][i];
    su[i] = (dp[to][0][0] + dp[to][1][0]) % mod;
    if (i + 1 < sz) su[i] = su[i] * su[i + 1] % mod;
  }
  long long s = 1;
  for (int to : g[v]) {
    s = s * dp[to][1][0] % mod;
  }
  dp[v][0][0] = 0;
  dp[v][0][1] = 1;
  dp[v][1][0] = s;
  dp[v][1][1] = 0;
  for (int i = 0; i < sz; ++i) {
    int to = g[v][i];
    long long add = dp[to][0][1];
    if (i - 1 >= 0) add = add * pre[i - 1] % mod;
    if (i + 1 < sz) add = add * su[i + 1] % mod;
    dp[v][0][0] += add;
    dp[v][0][0] %= mod;
  }
  (dp[v][1][0] += dp[v][0][0]) %= mod;
  for (int to : g[v]) {
    dp[v][0][1] = dp[v][0][1] * (dp[to][1][0] + dp[to][0][0]) % mod;
  }
}
vector<int> e[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (long long i = 1; i <= n - 1; ++i) {
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  int x = min(n, 3);
  dfs(x);
  cout << dp[x][1][0];
  return 0;
}
