#include <bits/stdc++.h>
using namespace std;
const long long maxn = 3e5 + 5, inf = 1e18, mod = 998244353;
long long n, dp[3][maxn];
vector<long long> adj[maxn];
long long pw(long long a, long long b) {
  long long res = 1;
  a %= mod;
  while (b) {
    if (b & 1ll) (res *= a) %= mod;
    (a *= a) %= mod;
    b /= 2ll;
  }
  return res;
}
void dfs(long long u, long long par) {
  long long z1 = 1, z2 = 1;
  for (long long j : adj[u]) {
    if (j == par) continue;
    dfs(j, u);
    (z1 *= (dp[0][j] + dp[1][j])) %= mod;
    (z2 *= (dp[0][j] + dp[1][j] * 2ll)) %= mod;
  }
  if (adj[u].size() == 1 && par != u) {
    dp[0][u] = 1;
    dp[2][u] = 1;
    return;
  }
  dp[0][u] = z1;
  dp[2][u] = z2;
  for (long long j : adj[u]) {
    if (j == par) continue;
    (dp[1][u] +=
     dp[2][j] * z2 % mod * pw(dp[0][j] + dp[1][j] * 2ll, mod - 2) % mod) %= mod;
  }
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  if (n == 1) return cout << 1 << endl, 0;
  for (long long i = 1; i < n; i++) {
    long long u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(1, 1);
  cout << (dp[0][1] + dp[1][1]) % mod << endl;
}
