#include <bits/stdc++.h>
using namespace std;
struct node {
  int to;
  node *next;
};
int i, j, m, n, x, y, deg[300005];
long long mod, dp[300005][4], ans;
node *nd[300005];
void addd(int u, int v) {
  node *p = new node();
  p->to = v;
  p->next = nd[u];
  nd[u] = p;
}
long long getinv(long long a, long long p) {
  if (a == 1) return 1;
  long long k = a - getinv(p % a, a);
  return (k * p + 1) / a;
}
void dfs(int u, int pre) {
  node *p = nd[u];
  if ((u > 1) && (deg[u] == 1)) {
    dp[u][1] = dp[u][2] = 0;
    dp[u][3] = 1;
    return;
  }
  long long pro1 = 1;
  long long pro2 = 1;
  while (p) {
    if (p->to != pre) {
      dfs(p->to, u);
      pro1 = pro1 * (dp[p->to][1] * 2 + dp[p->to][3]) % mod;
      pro2 = pro2 * (dp[p->to][1] + dp[p->to][3]) % mod;
    }
    p = p->next;
  }
  p = nd[u];
  int cnt = 0;
  dp[u][1] = 0;
  dp[u][2] = (pro1 + mod - pro2) % mod;
  dp[u][3] = pro2;
  while (p) {
    if (p->to != pre) {
      dp[u][1] += (dp[p->to][2] + dp[p->to][3]) * pro1 % mod *
                  getinv((dp[p->to][1] * 2 + dp[p->to][3]) % mod, mod) % mod;
    }
    p = p->next;
  }
  dp[u][1] %= mod;
}
int main() {
  mod = 998244353;
  scanf("%d", &n);
  if (n == 1) {
    printf("1\n");
    return 0;
  }
  for (i = 1; i <= n - 1; i++) {
    scanf("%d%d", &x, &y);
    deg[x]++;
    deg[y]++;
    addd(x, y);
    addd(y, x);
  }
  dfs(1, -1);
  ans = (dp[1][1] + dp[1][3]) % mod;
  printf("%lld\n", ans);
  return 0;
}
