#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
int n;
long long dp[300005][3];
long long temp[3];
vector<int> g[300005];
void dfs(int u, int fa) {
  dp[u][2] = 1;
  for (int i = 0; i < g[u].size(); i++) {
    int v = g[u][i];
    if (v != fa) {
      dfs(v, u);
      temp[0] = dp[u][0] * (dp[v][0] * 2 + dp[v][2]) % mod;
      temp[0] =
          (temp[0] + (dp[u][1] + dp[u][2]) * (dp[v][1] + dp[v][2]) % mod) % mod;
      temp[1] = dp[u][2] * dp[v][0] % mod;
      temp[1] = (temp[1] + dp[u][1] * (dp[v][0] * 2 + dp[v][2])) % mod;
      temp[2] = (dp[u][2] * (dp[v][2] + dp[v][0])) % mod;
      for (int j = 0; j <= 2; j++) dp[u][j] = temp[j];
    }
  }
}
int main() {
  cin >> n;
  for (int i = 1, u, v; i < n; i++) {
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(1, 0);
  cout << (dp[1][0] + dp[1][2]) % mod;
  return 0;
}
