#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool chkmin(T &x, T y) {
  return x > y ? x = y, 1 : 0;
}
template <typename T>
inline bool chkmax(T &x, T y) {
  return x < y ? x = y, 1 : 0;
}
inline void read(int &x) {
  char ch = getchar();
  int f = 1;
  x = 0;
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  x *= f;
}
int n;
long long dp[300050][3], cur[3];
vector<int> adj[300050];
void dfs(int u, int fa) {
  dp[u][0] = 1;
  for (auto v : adj[u])
    if (v != fa) {
      dfs(v, u);
      cur[0] = dp[u][0] * (dp[v][0] + dp[v][2]) % 998244353;
      cur[1] = (dp[u][0] * dp[v][2] + dp[u][1] * (dp[v][0] + (dp[v][2] << 1))) %
               998244353;
      cur[2] = ((dp[u][0] + dp[u][1]) * (dp[v][0] + dp[v][1]) +
                dp[u][2] * (dp[v][0] + (dp[v][2] << 1))) %
               998244353;
      for (register int i = 0; i <= 2; ++i) dp[u][i] = cur[i];
    }
}
int main() {
  int u, v;
  read(n);
  for (register int i = 1; i <= n - 1; ++i)
    read(u), read(v), adj[u].push_back(v), adj[v].push_back(u);
  dfs(1, 0);
  cout << (dp[1][0] + dp[1][2]) % 998244353 << endl;
  return 0;
}
