#include <bits/stdc++.h>
using namespace std;
const int N = 300005;
const int mod = 998244353;
long long dp[N][3];
struct edge {
  int to, next;
} g[N << 1];
int head[N], cnt;
void add(int u, int v) {
  g[++cnt].to = v;
  g[cnt].next = head[u];
  head[u] = cnt;
}
long long pw(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ans;
}
void dfs(int x, int fa) {
  dp[x][0] = dp[x][2] = 1;
  for (int i = head[x]; i; i = g[i].next) {
    int y = g[i].to;
    if (y == fa) continue;
    dfs(y, x);
    dp[x][0] = (dp[x][0] * (dp[y][0] + dp[y][1]) % mod) % mod;
    dp[x][1] = (dp[x][1] + pw((dp[y][0] + 2 * dp[y][1] % mod) % mod, mod - 2) *
                               dp[y][2] % mod) %
               mod;
    dp[x][2] = (dp[x][2] * (dp[y][0] + 2 * dp[y][1]) % mod) % mod;
  }
  dp[x][1] = dp[x][1] * dp[x][2] % mod;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    add(x, y);
    add(y, x);
  }
  dfs(1, 0);
  printf("%lld\n", (dp[1][0] + dp[1][1]) % mod);
}
