#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void read(T &x) {
  int f = 0;
  x = 0;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar()) f |= (ch == '-');
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  if (f) x = -x;
}
const int N = 200005;
const int mod = 998244353;
namespace {
void add(int &x, int y) { x = (x + y >= mod ? x + y - mod : x + y); }
int fix(int x) { return x >= mod ? x - mod : x; }
int mul(int x, int y) { return (long long)x * y % mod; }
}  // namespace
int f[N], g[N], h[N], n, a, b;
vector<pair<int, int> > e[N];
void dfs(int u, int fa, int x) {
  vector<pair<int, int> > sn;
  sn.push_back(make_pair(0, 0));
  for (auto v : e[u]) {
    if (v.first == fa) continue;
    dfs(v.first, u, v.second);
    sn.push_back(v);
  }
  int m = (int)sn.size() - 1;
  vector<int> pre, suf;
  pre.resize(m + 2);
  suf.resize(m + 2);
  pre[0] = 1;
  for (int i = (1); i <= (m); i++) {
    int x = sn[i].first;
    pre[i] = mul(pre[i - 1], fix(f[x] + g[x]));
  }
  suf[m + 1] = 1;
  for (int i = (m); i >= (1); i--) {
    int x = sn[i].first;
    suf[i] = mul(suf[i + 1], fix(f[x] + h[x]));
  }
  g[u] = 1;
  for (int i = (1); i <= (m); i++) {
    int p = sn[i].first, y = sn[i].second;
    if (y < x) {
      g[u] = mul(g[u], fix(f[p] + g[p]));
      add(f[u], mul(h[p], mul(pre[i - 1], suf[i + 1])));
    } else {
      g[u] = mul(g[u], fix(f[p] + h[p]));
      add(h[u], mul(h[p], mul(pre[i - 1], suf[i + 1])));
    }
  }
  add(h[u], pre[m]);
}
int main() {
  read(n);
  for (int i = (1); i <= (n - 1); i++) {
    read(a), read(b);
    e[a].push_back(make_pair(b, i));
    e[b].push_back(make_pair(a, i));
  }
  dfs(1, 0, n);
  cout << fix(f[1] + g[1]) << endl;
  return 0;
}
