#include <bits/stdc++.h>
using namespace std;
namespace FGF {
const int N = 3e5 + 5, mo = 998244353;
int dp[N][4], n, tmp[4];
vector<int> g[N];
void dfs(int u, int f) {
  dp[u][0] = dp[u][1] = dp[u][3] = 1;
  for (auto v : g[u])
    if (v != f) {
      dfs(v, u);
      memcpy(tmp, dp[u], sizeof(tmp));
      dp[u][0] = 1ll * tmp[0] * (dp[v][0] + dp[v][2]) % mo;
      dp[u][1] = 1ll * tmp[1] * (dp[v][0] + 2ll * dp[v][2] % mo) % mo;
      dp[u][2] = (1ll * tmp[2] * (dp[v][0] + 2ll * dp[v][2] % mo) % mo +
                  1ll * tmp[3] * dp[v][1] % mo) %
                 mo;
      dp[u][3] = 1ll * tmp[3] * (dp[v][0] + 2ll * dp[v][2] % mo) % mo;
    }
}
void work() {
  scanf("%d", &n);
  for (int i = 1, u, v; i < n; i++)
    scanf("%d%d", &u, &v), g[u].push_back(v), g[v].push_back(u);
  dfs(1, 0);
  printf("%d\n", (dp[1][0] + dp[1][2]) % mo);
}
}  // namespace FGF
int main() {
  FGF::work();
  return 0;
}
