#include <bits/stdc++.h>
const int maxn = 2e5 + 5;
const int mo = 998244353;
using namespace std;
int rd() {
  int x = 0, f = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) x = (x << 3) + (x << 1) + c - '0', c = getchar();
  return x * f;
}
int n, f[maxn][4], head[maxn];
vector<int> G[maxn];
void dfs(int u, int y) {
  f[u][1] = f[u][3] = 1;
  int sum = 1;
  bool flag = false;
  for (int v : G[u]) {
    if (v == y) {
      flag = true;
      continue;
    }
    dfs(v, u);
    f[u][2] = 1LL * f[u][2] * (1LL * f[v][0] + f[v][2] + f[v][3]) % mo;
    f[u][0] = 1LL * f[u][0] * (1LL * f[v][0] + f[v][2] + f[v][3]) % mo;
    if (flag) {
      f[u][1] = 1LL * f[u][1] * (1LL * f[v][0] + f[v][2] + f[v][3]) % mo;
      f[u][2] = (f[u][2] + 1LL * sum * (f[v][2] + f[v][3])) % mo;
    } else {
      f[u][0] = (f[u][0] + 1LL * sum * (f[v][2] + f[v][3])) % mo;
      f[u][1] = 1LL * f[u][1] * (1LL * f[v][0] + f[v][1]) % mo;
    }
    sum = 1LL * sum * (f[v][0] + f[v][1]) % mo;
    f[u][3] = 1LL * f[u][3] * (f[v][0] + f[v][1]) % mo;
  }
}
int main() {
  n = rd();
  for (int i = 1, u, v; i < n; i++)
    u = rd(), v = rd(), G[u].push_back(v), G[v].push_back(u);
  dfs(1, 0);
  printf("%d\n", (f[1][0] + f[1][3]) % mo);
  return 0;
}
