#include <bits/stdc++.h>
using namespace std;
inline char gc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline unsigned long long read() {
  unsigned long long x = 0;
  char ch = getchar();
  bool positive = 1;
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') positive = 0;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  return positive ? x : -x;
}
inline void write(unsigned long long a) {
  if (a < 0) {
    a = -a;
    putchar('-');
  }
  if (a >= 10) write(a / 10);
  putchar('0' + a % 10);
}
inline void wri(unsigned long long a) {
  write(a);
  putchar(' ');
}
inline void writeln(unsigned long long a) {
  write(a);
  puts("");
}
const int N = 300005, mod = 998244353;
unsigned long long n, dp[N][3], g[3];
vector<int> v[N];
void dfs(int p, int fa) {
  dp[p][0] = 1;
  for (auto i : v[p])
    if (i != fa) {
      dfs(i, p);
      g[0] = (dp[p][0] * (dp[i][0] + dp[i][2])) % mod;
      g[1] = (dp[p][0] * dp[i][2] + dp[p][1] * (dp[i][0] + dp[i][2] * 2)) % mod;
      g[2] =
          (dp[p][0] * (dp[i][0] + dp[i][1]) + dp[p][1] * (dp[i][0] + dp[i][1]) +
           dp[p][2] * (dp[i][0] + dp[i][2] * 2)) %
          mod;
      swap(g, dp[p]);
    }
}
signed main() {
  n = read();
  for (int i = 1; i < n; i++) {
    int s = read(), t = read();
    v[s].push_back(t);
    v[t].push_back(s);
  }
  dfs(1, 0);
  cout << (dp[1][0] + dp[1][2]) % mod << endl;
}
