#include <bits/stdc++.h>
using namespace std;
long long n;
long long dp[300005][3];
const long long p = 998244353;
vector<long long> e[300005];
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
inline void write(long long x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x >= 10) write(x / 10);
  putchar(x % 10 + '0');
}
inline void addEdge(long long u, long long v) { e[u].push_back(v); }
inline long long Mul(long long x, long long y) { return x * y % p; }
inline long long Add(long long x, long long y) { return (x + y) % p; }
void dfs(long long u, long long fa) {
  dp[u][0] = 1, dp[u][1] = 0, dp[u][2] = 0;
  for (long long v : e[u]) {
    if (v == fa) continue;
    dfs(v, u);
    long long f0 = Mul(dp[u][0], dp[v][2] + dp[v][0]);
    long long f1 = Add(Mul(dp[v][2], dp[u][0]),
                       Mul(dp[u][1], ((dp[v][2] << 1) + dp[v][0])));
    long long f2 = (Mul(dp[u][0], Add(dp[v][1], dp[v][0])) +
                    Mul(dp[u][1], Add(dp[v][1], dp[v][0])) +
                    Mul(dp[u][2], Add((dp[v][2] << 1), dp[v][0]))) %
                   p;
    dp[u][0] = f0, dp[u][1] = f1, dp[u][2] = f2;
  }
}
signed main() {
  n = read();
  for (long long i = 1, u, v; i < n; i++)
    u = read(), v = read(), addEdge(u, v), addEdge(v, u);
  dfs(1, 0);
  cout << (dp[1][0] + dp[1][2]) % p << endl;
  return 0;
}
