#include <bits/stdc++.h>
using namespace std;
const long long N = 300011;
long long dp[N][3], mod = 998244353;
int n;
vector<int> g[N];
long long poww(long long x, long long y) {
  x %= mod;
  if (y == 0) return 1;
  if (y == 1) return x;
  long long k = poww(x, y / 2);
  k = (k * k) % mod;
  if (y & 1) return (k * x) % mod;
  return k;
}
void dfs(int v, int par) {
  dp[v][0] = dp[v][2] = 1;
  for (int i = 0; i < g[v].size(); i++) {
    int u = g[v][i];
    if (u == par) continue;
    dfs(u, v);
    dp[v][0] = (dp[v][0] * (dp[u][0] + dp[u][1])) % mod;
    dp[v][2] = (dp[v][2] * (dp[u][1] + dp[u][1] + dp[u][0])) % mod;
  }
  for (int i = 0; i < g[v].size(); i++) {
    int u = g[v][i];
    if (u == par) continue;
    dp[v][1] =
        (dp[v][1] +
         (((dp[v][2] * poww(dp[u][0] + dp[u][1] + dp[u][1], mod - 2)) % mod) *
          dp[u][2]) %
             mod) %
        mod;
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &v, &u);
    g[v].push_back(u);
    g[u].push_back(v);
  }
  dfs(1, 0);
  cout << (dp[1][1] + dp[1][0]) % mod;
}
