#include <bits/stdc++.h>
using namespace std;
const long long mm = 998244353ll;
const int maxn = 300500;
vector<int> g[maxn];
long long f[maxn][3];
int n;
void dfs(int u, int fa) {
  f[u][0] = 1;
  for (auto v : g[u]) {
    if (v == fa) continue;
    dfs(v, u);
    long long f0 = f[u][0] * (f[v][0] + f[v][1]) % mm;
    long long f1 = f[u][1] * (f[v][0] + f[v][1]) % mm;
    long long f2 = f[u][2] * (f[v][0] + f[v][1]) % mm;
    f1 = (f1 + f[u][0] * (f[v][0] + f[v][2]) % mm + f[u][1] * f[v][1] % mm +
          f[u][2] * (f[v][0] + f[v][2]) % mm) %
         mm;
    f2 = (f2 + f[u][2] * f[v][1] % mm + f[u][0] * f[v][1] % mm) % mm;
    f[u][0] = f0;
    f[u][1] = f1;
    f[u][2] = f2;
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs(1, 0);
  printf("%lld\n", (f[1][0] + f[1][1]) % mm);
  return 0;
}
