#include <bits/stdc++.h>
using namespace std;
inline int readint() {
  int a = 0;
  char c = getchar(), f = 1;
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-') f = -f;
  for (; '0' <= c && c <= '9'; c = getchar())
    a = (a << 3) + (a << 1) + (c ^ 48);
  return a * f;
}
inline void writeint(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) writeint(x / 10);
  putchar((x % 10) ^ 48);
}
template <class T>
void getMax(T& a, T b) {
  if (a < b) a = b;
}
template <class T>
void getMin(T& a, T b) {
  if (b < a) a = b;
}
const int MaxN = 300005;
struct Edge {
  int to, nxt;
  Edge(int T = 0, int N = 0) { to = T, nxt = N; }
} edge[MaxN << 1];
int head[MaxN], cntEdge, n;
void addEdge(int a, int b) {
  edge[cntEdge] = Edge(b, head[a]);
  head[a] = cntEdge++;
  edge[cntEdge] = Edge(a, head[b]);
  head[b] = cntEdge++;
}
const int Mod = 998244353;
int dp[MaxN][3];
int tmp[3];
void dfs(int x, int pre) {
  dp[x][2] = 1;
  for (int i = head[x], y; ~i; i = edge[i].nxt) {
    if (edge[i].to == pre) continue;
    dfs(y = edge[i].to, x);
    tmp[0] = 1ll * (dp[x][1] + dp[x][2]) * (dp[y][1] + dp[y][2]) % Mod;
    tmp[0] = (tmp[0] + dp[x][0] * (dp[y][0] * 2ll + dp[y][2])) % Mod;
    tmp[1] = (1ll * dp[x][2] * dp[y][0] % Mod +
              dp[x][1] * (2ll * dp[y][0] + dp[y][2])) %
             Mod;
    tmp[2] = 1ll * dp[x][2] * (dp[y][0] + dp[y][2]) % Mod;
    for (int j = 0; j < 3; ++j) dp[x][j] = tmp[j];
  }
}
int main() {
  int n = readint();
  for (int i = 1; i <= n; ++i) head[i] = -1;
  for (int i = 1; i < n; ++i) addEdge(readint(), readint());
  dfs(1, -1);
  int ans = dp[1][0];
  ans = (ans + dp[1][2]) % Mod;
  printf("%d\n", ans);
  return 0;
}
