#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10, skc = 998244353;
vector<int> v[N], edge[N];
void add(int x, int y, int z) {
  v[x].push_back(y);
  edge[x].push_back(z);
}
void upd(int &x, int y) { x = (x + y) % skc; }
int f[N][3], n;
struct node {
  int id, vl;
  friend bool operator<(node A, node B) { return A.vl < B.vl; }
};
void dfs(int x, int w, int fa) {
  int l = v[x].size(), y, z, t = 1;
  f[x][1] = 1;
  vector<node> c;
  c.clear();
  for (register int i = (0); i <= (l - 1); ++i) {
    y = v[x][i];
    z = edge[x][i];
    if (y == fa) continue;
    dfs(y, z, x);
    if (z < w)
      f[x][1] = 1ll * f[x][1] * (f[y][0] + f[y][1]) % skc;
    else
      f[x][1] = 1ll * f[x][1] * (f[y][0] + f[y][2]) % skc;
    c.push_back((node){y, z});
  }
  sort(c.begin(), c.end());
  int len = c.size();
  vector<int> pre(len + 2), suf(len + 2);
  pre[0] = suf[len + 1] = 1;
  for (register int i = (1); i <= (len); ++i)
    pre[i] = 1ll * pre[i - 1] * (f[c[i - 1].id][0] + f[c[i - 1].id][1]) % skc;
  for (register int i = (len); i >= (1); --i)
    suf[i] = 1ll * suf[i + 1] * (f[c[i - 1].id][0] + f[c[i - 1].id][2]) % skc;
  for (register int i = (1); i <= (len); ++i)
    if (c[i - 1].vl < w)
      upd(f[x][0],
          1ll * f[c[i - 1].id][2] * pre[i - 1] % skc * suf[i + 1] % skc);
    else
      upd(f[x][2],
          1ll * f[c[i - 1].id][2] * pre[i - 1] % skc * suf[i + 1] % skc);
  upd(f[x][2], pre[len]);
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  int x, y;
  for (register int i = (1); i <= (n - 1); ++i) {
    cin >> x >> y;
    add(x, y, i);
    add(y, x, i);
  }
  dfs(1, n, 0);
  cout << (f[1][0] + f[1][2]) % skc << '\n';
  return 0;
}
