#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch - '0' < 0 || ch - '0' > 9) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch - '0' >= 0 && ch - '0' <= 9) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int n;
int head[200010], nxt[200010 * 2], to[200010 * 2], tot;
void add(int u, int v) {
  tot++;
  nxt[tot] = head[u];
  head[u] = tot;
  to[tot] = v;
}
int fa_id[200010], p[200010], top;
bool cmp(int x, int y) { return fa_id[x] < fa_id[y]; }
int pre[200010], suf[200010];
int f[200010][4];
void addx(int &x, int y) {
  x = (x + y >= 998244353) ? x + y - 998244353 : x + y;
}
void dfs(int x, int las) {
  for (int i = head[x]; i; i = nxt[i]) {
    if (to[i] == las) continue;
    fa_id[to[i]] = ((i + 1) >> 1);
    dfs(to[i], x);
  }
  top = 0;
  for (int i = head[x]; i; i = nxt[i])
    if (to[i] != las) p[++top] = to[i];
  p[top + 1] = 0;
  sort(p + 1, p + top + 1, cmp);
  pre[0] = suf[top + 1] = 1;
  for (int i = 1; i <= top; i++)
    pre[i] = 1ll * pre[i - 1] * (f[p[i]][0] + f[p[i]][1]) % 998244353;
  for (int i = top; i >= 1; i--)
    suf[i] = 1ll * suf[i + 1] * (1ll * f[p[i]][0] + f[p[i]][2] + f[p[i]][3]) %
             998244353;
  int d = 0;
  for (int i = top; i >= 1; i--) {
    if (fa_id[x] > fa_id[p[i]] && fa_id[x] < fa_id[p[i + 1]]) {
      d = i;
      break;
    }
  }
  for (int i = 1; i <= d; i++)
    addx(f[x][0], 1ll * pre[i - 1] * suf[i + 1] % 998244353 *
                      (f[p[i]][2] + f[p[i]][3]) % 998244353);
  for (int i = d + 1; i <= top; i++)
    addx(f[x][2], 1ll * pre[i - 1] * suf[i + 1] % 998244353 *
                      (f[p[i]][2] + f[p[i]][3]) % 998244353);
  f[x][1] = 1ll * pre[d] * suf[d + 1] % 998244353;
  f[x][3] = pre[top];
}
int main() {
  n = read();
  for (int i = 1; i < n; i++) {
    int q = read(), w = read();
    add(q, w);
    add(w, q);
  }
  fa_id[0] = 1000000007;
  dfs(1, 0);
  int ans = (1ll * f[1][0] + f[1][2] + f[1][3]) % 998244353;
  cout << ans << endl;
  return 0;
}
