#include <bits/stdc++.h>
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
using namespace std;
namespace ywy {
inline int get() {
  int n = 0;
  char c;
  while ((c = getchar()) || 23333) {
    if (c >= '0' && c <= '9') break;
    if (c == '-') goto s;
  }
  n = c - '0';
  while ((c = getchar()) || 23333) {
    if (c >= '0' && c <= '9')
      n = n * 10 + c - '0';
    else
      return (n);
  }
s:
  while ((c = getchar()) || 23333) {
    if (c >= '0' && c <= '9')
      n = n * 10 - c + '0';
    else
      return (n);
  }
}
long long dp[300001][3];
typedef struct _b {
  int dest;
  int nxt;
} bian;
bian memchi[1000001];
int gn = 1, heads[300001];
inline void add(int s, int t) {
  memchi[gn].dest = t;
  memchi[gn].nxt = heads[s];
  heads[s] = gn;
  gn++;
}
void dfs(int pt, int baba) {
  dp[pt][0] = 1;
  for (register int i = heads[pt]; i; i = memchi[i].nxt) {
    if (memchi[i].dest == baba) continue;
    dfs(memchi[i].dest, pt);
    long long d0 = dp[pt][0], d1 = dp[pt][1], d2 = dp[pt][2];
    dp[pt][1] = (d1 * dp[memchi[i].dest][0] + d1 * dp[memchi[i].dest][1] * 2) %
                998244353;
    dp[pt][1] =
        (dp[pt][1] + d0 * dp[memchi[i].dest][2] + d0 * dp[memchi[i].dest][0]) %
        998244353;
    dp[pt][1] =
        (dp[pt][1] + d2 * dp[memchi[i].dest][0] + d2 * dp[memchi[i].dest][2]) %
        998244353;
    dp[pt][0] =
        (d0 * dp[memchi[i].dest][1] + d0 * dp[memchi[i].dest][0]) % 998244353;
    dp[pt][2] = (d0 * dp[memchi[i].dest][1] + d2 * dp[memchi[i].dest][1] * 2 +
                 d2 * dp[memchi[i].dest][0]) %
                998244353;
  }
}
void ywymain() {
  int n = get();
  for (register int i = 1; i < n; i++) {
    int s = get(), t = get();
    add(s, t);
    add(t, s);
  }
  dfs(1, 0);
  cout << (dp[1][0] + dp[1][1]) % 998244353 << endl;
}
}  // namespace ywy
int main() {
  ywy::ywymain();
  return (0);
}
