#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
int const N = 3e5 + 20, mod = 998244353;
int n;
vector<int> g[N];
int dp[N][2], ss[N];
void dfs(int v, int par = -1) {
  dp[v][0] = 0;
  dp[v][1] = 1;
  ss[v] = 1;
  for (int u : g[v]) {
    if (u == par) continue;
    dfs(u, v);
    int a = (2ll * dp[u][0] + ss[u]) % mod, b = dp[u][1];
    dp[v][0] = (1ll * dp[v][1] * b + 1ll * dp[v][0] * a) % mod;
    dp[v][1] = 1ll * dp[v][1] * a % mod;
    ss[v] = 1ll * ss[v] * (dp[u][0] + ss[u]) % mod;
  }
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 0, u, v; i < n - 1; i++) {
    cin >> u >> v;
    u--, v--;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(0);
  cout << (dp[0][0] + ss[0]) % mod << '\n';
}
