#include <bits/stdc++.h>
using namespace std;
vector<int> g[300000];
int used[300000];
long long mod = 998244353;
long long dp[300000][3];
long long bin_pow(long long x) {
  long long k = mod - 2, ret = 1;
  while (k) {
    if (k & 1) ret = (ret * x) % mod;
    k /= 2;
    x = (x * x) % mod;
  }
  return ret;
}
void dfs(int v) {
  dp[v][2] = 1;
  int u;
  long long p = 1, x;
  for (int i = 0; i < g[v].size(); i++) {
    u = g[v][i];
    if (used[u] != -1) continue;
    used[u] = v;
    dfs(u);
    dp[v][2] = (dp[v][2] * dp[u][2]) % mod;
    p = (p * (dp[u][0] + dp[u][2])) % mod;
  }
  dp[v][1] = p;
  for (int i = 0; i < g[v].size(); i++) {
    u = g[v][i];
    if (used[u] != v) continue;
    x = bin_pow((dp[u][0] + dp[u][2]) % mod);
    dp[v][0] = (dp[v][0] + (dp[u][1] * ((p * x) % mod)) % mod) % mod;
  }
  dp[v][2] = (dp[v][0] + dp[v][2]) % mod;
}
int main() {
  int n, v, u;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    cin >> u >> v;
    u--;
    v--;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (int i = 0; i < n; i++) used[i] = -1;
  used[0] = 0;
  dfs(0);
  cout << dp[0][2];
}
