#include <bits/stdc++.h>
using std::vector;
const int MAXN = 3e5 + 20, M = 998244353;
namespace MyIO {
const int MAXB = 1 << 18;
char gbuf[MAXB], *ps = gbuf, *pt = gbuf;
char pbuf[MAXB + 1], *pp = pbuf;
struct Flusher {
  ~Flusher() { fwrite(pbuf, 1, pp - pbuf, stdout); }
} flusher;
inline char Getchar() {
  if (ps == pt) {
    ps = gbuf;
    pt = gbuf + fread(gbuf, 1, MAXB, stdin);
  }
  return (ps == pt) ? EOF : *ps++;
}
inline void Putchar(const char &ch) {
  if (pp == pbuf + MAXB) {
    pp = pbuf;
    fwrite(pbuf, 1, MAXB, stdout);
  }
  *pp++ = ch;
}
}  // namespace MyIO
int read() {
  int x = 0;
  char c = MyIO::Getchar();
  while (c < '0' || c > '9') c = MyIO::Getchar();
  while (c >= '0' && c <= '9')
    x = (x << 1) + (x << 3) + (48 ^ c), c = MyIO::Getchar();
  return x;
}
void write(const int &x) {
  if (x / 10) write(x / 10);
  MyIO::Putchar('0' + x % 10);
}
vector<int> E[MAXN];
inline void addedge(const int &u, const int &v) {
  E[u].push_back(v);
  E[v].push_back(u);
}
int dp[3][MAXN];
void dfs(const int &u, const int &fa) {
  for (int v : E[u])
    if (v != fa) dfs(v, u);
  vector<int> pre, suf;
  pre.push_back(1);
  for (int v : E[u])
    if (v != fa)
      pre.push_back(1ll * pre[pre.size() - 1] * (dp[0][v] + dp[2][v] * 2ll) %
                    M);
  suf.push_back(1);
  for (int i = E[u].size() - 1; i >= 0; --i) {
    int v = E[u][i];
    if (v != fa)
      suf.push_back(1ll * suf[suf.size() - 1] * (dp[0][v] + dp[2][v] * 2ll) %
                    M);
  }
  int Size = pre.size() - 1;
  dp[0][u] = 1;
  for (int v : E[u])
    if (v != fa) dp[0][u] = 1ll * dp[0][u] * (dp[0][v] + dp[2][v]) % M;
  dp[1][u] = pre[Size];
  int i = 1;
  for (int v : E[u])
    if (v != fa) {
      dp[2][u] =
          (dp[2][u] + 1ll * dp[1][v] * pre[i - 1] % M * suf[Size - i] % M) % M;
      ++i;
    }
}
int main() {
  int n = read();
  for (int i = 0; i < n - 1; ++i) addedge(read(), read());
  dfs(1, 0);
  printf("%d", (dp[0][1] + dp[2][1]) % M);
}
