#include <bits/stdc++.h>
using namespace std;
long long n, g[3], dp[300300][3];
struct edge {
  long long v;
  edge *next;
} pool[300300 << 1], *h[300300], *cnt = pool;
inline void addedge(long long u, long long v) {
  edge *p = ++cnt, *q = ++cnt;
  p->v = v, p->next = h[u], h[u] = p;
  q->v = u, q->next = h[v], h[v] = q;
}
inline void dfs(long long u, long long fa) {
  long long v;
  dp[u][0] = 1;
  for (edge *p = h[u]; p; p = p->next)
    if ((v = p->v) != fa) {
      dfs(v, u);
      g[0] = (dp[u][0] * (dp[v][0] + dp[v][2])) % 998244353,
      g[1] = (dp[u][0] * dp[v][2] + dp[u][1] * (dp[v][0] + (dp[v][2] << 1))) %
             998244353,
      g[2] =
          (dp[u][0] * (dp[v][0] + dp[v][1]) + dp[u][1] * (dp[v][0] + dp[v][1]) +
           dp[u][2] * (dp[v][0] + (dp[v][2] << 1))) %
          998244353;
      swap(g, dp[u]);
    }
}
signed main() {
  long long u, v;
  scanf("%lld", &n);
  for (long long i = 1; i < n; i++) {
    scanf("%lld%lld", &u, &v);
    addedge(u, v);
  }
  dfs(1, 0);
  printf("%lld\n", (dp[1][0] + dp[1][2]) % 998244353);
  return 0;
}
