#include <bits/stdc++.h>
using namespace std;
int const N = 300000, md = 998244353;
vector<int> tr[N + 1];
int w[N + 1][3], t[3];
void ad(int &x, int y) {
  if ((x += y) >= md) x -= md;
}
void go(int v = 1, int p = 0) {
  w[v][2] = 1;
  for (int i = 0; i < (int)(tr[v].size()); ++i) {
    int u = tr[v][i];
    if (u == p) continue;
    go(u, v);
    for (int i = 0; i < (int)(3); ++i) t[i] = 0;
    ad(t[1], (long long)w[v][0] * w[u][0] % md);
    ad(t[0], (long long)w[v][0] * w[u][1] % md);
    ad(t[0], (long long)w[v][0] * w[u][1] % md);
    ad(t[1], (long long)w[v][0] * w[u][2] % md);
    ad(t[0], (long long)w[v][0] * w[u][2] % md);
    ad(t[1], (long long)w[v][1] * w[u][1] % md);
    ad(t[1], (long long)w[v][1] * w[u][1] % md);
    ad(t[1], (long long)w[v][1] * w[u][2] % md);
    ad(t[1], (long long)w[v][2] * w[u][0] % md);
    ad(t[2], (long long)w[v][2] * w[u][1] % md);
    ad(t[0], (long long)w[v][2] * w[u][1] % md);
    ad(t[1], (long long)w[v][2] * w[u][2] % md);
    ad(t[2], (long long)w[v][2] * w[u][2] % md);
    for (int i = 0; i < (int)(3); ++i) w[v][i] = t[i];
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < (int)(n); ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    tr[a].push_back(b);
    tr[b].push_back(a);
  }
  go();
  int an = w[1][1];
  ad(an, w[1][2]);
  printf("%d\n", an);
}
