#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5, MOD = 998244353;
int dp[N][4];
vector<int> g[N];
int sum(int a, int b) { return a + b - (a + b >= MOD ? MOD : 0); }
int mul(int a, int b) { return 1ll * a * b % MOD; }
int Pow(int a, int b = MOD - 2) {
  int res = 1;
  for (; b; b >>= 1, a = mul(a, a))
    if (b & 1) res = mul(res, a);
  return res;
}
void dfs(int v, int p = 0) {
  dp[v][1] = dp[v][2] = 1;
  for (int u : g[v])
    if (u != p) {
      dfs(u, v), dp[u][3] = sum(dp[u][2], mul(dp[u][0], 2));
      dp[v][1] = mul(dp[v][1], dp[u][3]);
      dp[v][2] = mul(dp[v][2], sum(dp[u][0], dp[u][2]));
    }
  for (int u : g[v])
    if (u != p)
      dp[v][0] = sum(dp[v][0], mul(mul(dp[v][1], Pow(dp[u][3])), dp[u][1]));
  return;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v), g[v].push_back(u);
  }
  dfs(1);
  cout << sum(dp[1][0], dp[1][2]) << "\n";
  return 0;
}
