#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long f = 1, x = 0;
  char s = getchar();
  while (s < '0' || s > '9') {
    if (s == '-') f = -1;
    s = getchar();
  }
  while (s >= '0' && s <= '9') {
    x = x * 10 + (s - '0');
    s = getchar();
  }
  return x * f;
}
const int jzm = 998244353;
inline int ABS(int x) { return x < 0 ? -x : x; }
int n, m, i, j, s, o, k;
struct it {
  int v, w;
  it() { v = w = 0; }
  it(int V, int W) {
    v = V;
    w = W;
  }
};
vector<int> g[300005];
int dp[300005][3];
const int LOG = 17;
void dfs(int x, int fa) {
  dp[x][0] = 0;
  dp[x][1] = dp[x][2] = 1;
  for (int i = 0; i < g[x].size(); i++) {
    int y = g[x][i];
    if (y != fa) {
      dfs(y, x);
      dp[x][0] = (dp[x][0] * 1ll * (dp[y][0] * 2ll + dp[y][2]) % jzm + 0ll +
                  dp[x][1] * 1ll * dp[y][1] % jzm) %
                 jzm;
      dp[x][1] = dp[x][1] * 1ll * (dp[y][0] * 2ll + dp[y][2]) % jzm;
      dp[x][2] = dp[x][2] * 1ll * (dp[y][0] + 0ll + dp[y][2]) % jzm;
    }
  }
  return;
}
int main() {
  n = read();
  for (int i = 1; i < n; i++) {
    s = read();
    o = read();
    g[s].push_back(o);
    g[o].push_back(s);
  }
  dfs(1, 0);
  printf("%d\n", (dp[1][0] + 0ll + dp[1][2]) % jzm);
  return 0;
}
