#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
using ll = long long;
using db = long double;
using row = vector<int>;
using ii = pair<int, int>;
const int N = 3e5 + 5, A = 6561, LG = 19, MOD = 998244353;
const int SQ = 450;
const long double EPS = 1e-7;
int dp[N][3], n;
vector<int> adj[N];
inline int mul(int x, int y) { return 1ll * x * y % MOD; }
inline int add(int x, int y) {
  if ((x += y) >= MOD) x -= MOD;
  return x;
}
inline int fast(int x, int y, int res = 1) {
  for (; y; y >>= 1, x = 1ll * x * x % MOD)
    if (y & 1) res = 1ll * res * x % MOD;
  return res;
}
void dfs(int node, int par) {
  for (auto child : adj[node])
    if (child != par) {
      dfs(child, node);
    }
  dp[node][2] = 1;
  for (auto child : adj[node])
    if (child != par) {
      dp[node][2] = mul(dp[node][2], add(dp[child][0], dp[child][2]));
    }
  int sum = 1;
  for (auto child : adj[node]) {
    if (child != par) {
      sum = mul(sum, add(dp[child][2], add(dp[child][0], dp[child][0])));
    }
  }
  for (auto child : adj[node])
    if (child != par) {
      dp[node][0] = add(
          dp[node][0],
          mul(add(dp[child][1], dp[child][2]),
              mul(sum, fast(add(dp[child][2], add(dp[child][0], dp[child][0])),
                            MOD - 2))));
    }
  sum = 0;
  int cur[2][2] = {};
  cur[0][0] = 1;
  bool f = 0;
  for (auto child : adj[node])
    if (child != par) {
      f ^= 1;
      cur[f][0] = mul(cur[f ^ 1][0], add(dp[child][0], dp[child][2]));
      cur[f][1] = add(mul(cur[f ^ 1][0], dp[child][0]),
                      mul(cur[f ^ 1][1],
                          add(add(dp[child][0], dp[child][0]), dp[child][2])));
    }
  dp[node][1] = cur[f][1];
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(1, 1);
  cout << add(dp[1][0], dp[1][2]) << '\n';
  return 0;
}
