#include <bits/stdc++.h>
using namespace std;
const int mx = 3e5 + 5;
const int mod = 998244353;
int n, t1, t2;
int dp1[mx], dp2[mx], dp3[mx];
int pd1, pd2, pd3;
vector<int> adj[mx];
void dfs(int v, int p = -1) {
  dp2[v] = 1, dp3[v] = 1;
  for (auto u : adj[v]) {
    if (u != p) {
      dfs(u, v);
      pd1 = (pd1 + ((1ll * dp1[v] * (dp1[u] + dp3[u])) % mod)) % mod;
      pd1 = (1ll * pd1 + ((1ll * dp1[v] * dp1[u]) % mod) +
             ((1ll * dp2[v] * dp2[u]) % mod)) %
            mod;
      pd2 = (pd2 + ((1ll * dp2[v] * (dp1[u] + dp3[u])) % mod)) % mod;
      pd2 = (((1ll * dp2[v] * dp1[u]) % mod) + pd2) % mod;
      pd3 = (((1ll * dp3[v] * (dp1[u] + dp3[u])) % mod) + pd3) % mod;
      dp1[v] = pd1;
      dp2[v] = pd2;
      dp3[v] = pd3;
      pd1 = pd2 = pd3 = 0;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &t1, &t2);
    adj[t1].push_back(t2);
    adj[t2].push_back(t1);
  }
  dfs(1);
  cout << (1ll * dp1[1] + dp3[1]) % mod << "\n";
}
