#include <bits/stdc++.h>
using namespace std;
const long long N = 3e5 + 10;
const long long mod = 998244353;
long long n, dp1[N], dp2[N], dp3[N], tmp1, tmp2;
vector<long long> adj[N];
void DFS(long long v, long long p) {
  dp2[v] = 1;
  dp3[v] = 1;
  for (auto u : adj[v]) {
    if (u != p) {
      DFS(u, v);
      long long pd1 = 0, pd2 = 0, pd3 = 0;
      pd1 += dp1[v] * (dp1[u] + dp3[u]);
      pd1 += (dp1[v] * dp1[u]) + (dp2[v] * dp2[u]);
      pd2 += dp2[v] * (dp1[u] + dp3[u]);
      pd2 += dp2[v] * dp1[u];
      pd3 += dp3[v] * (dp1[u] + dp3[u]);
      dp1[v] = pd1;
      dp1[v] %= mod;
      dp2[v] = pd2;
      dp2[v] %= mod;
      dp3[v] = pd3;
      dp3[v] %= mod;
    }
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (long long i = 1; i < n; i++) {
    cin >> tmp1 >> tmp2;
    adj[tmp1].push_back(tmp2);
    adj[tmp2].push_back(tmp1);
  }
  DFS(1, 0);
  cout << (dp1[1] + dp3[1]) % mod;
  return 0;
}
