#include <bits/stdc++.h>
using namespace std;
struct edge {
  int to, next;
} ed[600010];
const int mod = 998244353;
int sz, head[300010];
long long f[300010][3];
inline void add_edge(int from, int to) {
  ed[++sz].to = to;
  ed[sz].next = head[from];
  head[from] = sz;
}
inline int read() {
  char c = getchar();
  int x = 0, flag = 1;
  while (!isdigit(c)) {
    if (c == '-') flag = -1;
    c = getchar();
  }
  while (isdigit(c)) x = x * 10 + c - '0', c = getchar();
  return x * flag;
}
void dfs(int u, int ff) {
  f[u][0] = 1;
  for (int i = head[u]; i; i = ed[i].next) {
    int v = ed[i].to;
    if (v == ff) continue;
    dfs(v, u);
    long long f0 = f[u][0], f1 = f[u][1], f2 = f[u][2];
    f[u][0] = f0 * (f[v][2] + f[v][0]) % mod;
    f[u][1] = (f0 * f[v][2] + f1 * (2 * f[v][2] + f[v][0])) % mod;
    f[u][2] =
        ((f0 + f1) * (f[v][1] + f[v][0]) + f2 * (2 * f[v][2] + f[v][0])) % mod;
  }
}
int main() {
  int n = read();
  for (int i = 1; i < n; i++) {
    int u = read(), v = read();
    add_edge(u, v);
    add_edge(v, u);
  }
  dfs(1, 0);
  cout << (f[1][0] + f[1][2]) % mod;
  return 0;
}
