#include <bits/stdc++.h>
using namespace std;
const int maxN = 300001, mod = 998244353;
long long dp[3][maxN];
vector<int> G[maxN];
long long dpok(int v) { return (dp[1][v] + dp[2][v]) % mod; }
long long dpnotm(int v) { return (dp[0][v] + dp[2][v]) % mod; }
void dfs(int v, int fath) {
  dp[2][v] = 1;
  for (int u : G[v])
    if (u != fath) {
      dfs(u, v);
      static long long res[3];
      res[0] = dpnotm(v) * dp[1][u] % mod;
      res[0] = (res[0] + dp[0][v] * dpok(u)) % mod;
      res[1] = dp[1][v] * dp[1][u] % mod;
      res[1] = (res[1] + dpnotm(v) * dpnotm(u)) % mod;
      res[1] = (res[1] + dp[1][v] * dpok(u)) % mod;
      res[2] = dp[2][v] * dpok(u) % mod;
      for (int(s) = (0); (s) < (3); (s)++) dp[s][v] = res[s];
    }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int(i) = (1); (i) < (n); (i)++) {
    int a, b;
    scanf("%d%d", &a, &b);
    G[a].push_back(b);
    G[b].push_back(a);
  }
  dfs(1, 0);
  printf("%d\n", (dp[1][1] + dp[2][1]) % mod);
  return 0;
}
