#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using namespace std;
const int infi = 1e9 + 7;
const long long infl = 1e18 + 7;
const long long mod = 998244353;
vector<vector<int> > g;
long long dp[300500][3];
void dfs(int v, int p = -1) {
  dp[v][0] = 1;
  for (int to : g[v]) {
    if (to == p) continue;
    dfs(to, v);
    long long q, w, e;
    q = w = e = 0;
    q = dp[v][0] * (dp[to][0] + dp[to][2]);
    w += dp[v][1] * (dp[to][0] + dp[to][2]);
    e += dp[v][2] * (dp[to][0] + dp[to][2]);
    q %= mod, w %= mod, e %= mod;
    w += (dp[v][0] + dp[v][1]) * (dp[to][2]);
    e += dp[v][2] * dp[to][2];
    w %= mod, e %= mod;
    e += (dp[v][0] + dp[v][1]) * (dp[to][0] + dp[to][1]);
    e %= mod;
    dp[v][0] = q % mod;
    dp[v][1] = w % mod;
    dp[v][2] = e % mod;
  }
}
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  g.resize(n);
  for (int i = 0; i < (n - 1); ++i) {
    int u, v;
    cin >> u >> v;
    --u, --v;
    g[v].emplace_back(u);
    g[u].emplace_back(v);
  }
  dfs(0);
  cout << (dp[0][0] + dp[0][2]) % mod << endl;
  return 0;
}
