#include <bits/stdc++.h>
using namespace std;
const int N = (int)2e5 + 123, inf = 1e9, mod = 998244353;
const long long INF = 1e18;
vector<int> g[N];
int n, second[N], t[N];
long long A[N], B[N], C[N];
long long pre1[N], suf1[N];
long long pre2[N], suf2[N];
void dfs(int v, int p = -1) {
  vector<pair<int, int> > v1, v2;
  for (auto i : g[v]) {
    if (i == p) continue;
    int to = second[i] ^ t[i] ^ v;
    dfs(to, i);
    if (i < p)
      v1.push_back({i, to});
    else
      v2.push_back({i, to});
  }
  sort(v1.begin(), v1.end());
  sort(v2.begin(), v2.end());
  long long a = 0, b = 0, c = 0, d = 0;
  for (int i = 0; i < v1.size(); i++)
    if (i != 0)
      pre1[i] = pre1[i - 1] * B[v1[i].second] % mod;
    else
      pre1[i] = B[v1[i].second];
  for (int i = v1.size() - 1; i >= 0; i--)
    if (i != v1.size() - 1)
      suf1[i] = suf1[i + 1] * C[v1[i].second] % mod;
    else
      suf1[i] = C[v1[i].second];
  for (int i = 0; i < v2.size(); i++)
    if (i != 0)
      pre2[i] = pre2[i - 1] * B[v2[i].second] % mod;
    else
      pre2[i] = B[v2[i].second];
  for (int i = v2.size() - 1; i >= 0; i--)
    if (i != v2.size() - 1)
      suf2[i] = suf2[i + 1] * C[v2[i].second] % mod;
    else
      suf2[i] = C[v2[i].second];
  for (int i = 0; i < v1.size(); i++) {
    long long cur = A[v1[i].second];
    if (i != 0) cur = cur * pre1[i - 1] % mod;
    if (i != v1.size() - 1) cur = cur * suf1[i + 1] % mod;
    if (v2.size() != 0) cur = cur * suf2[0] % mod;
    a = (a + cur) % mod;
  }
  {
    long long cur = 1;
    for (int j = 0; j < v1.size(); j++) cur = cur * B[v1[j].second] % mod;
    for (int j = 0; j < v2.size(); j++) cur = cur * C[v2[j].second] % mod;
    c = cur;
  }
  for (int i = 0; i < v2.size(); i++) {
    long long cur = A[v2[i].second];
    if (i != 0) cur = cur * pre2[i - 1] % mod;
    if (i != v2.size() - 1) cur = cur * suf2[i + 1] % mod;
    if (v1.size() != 0) cur = cur * pre1[v1.size() - 1] % mod;
    b = (b + cur) % mod;
  }
  {
    long long cur = 1;
    for (int j = 0; j < v1.size(); j++) cur = cur * B[v1[j].second] % mod;
    for (int j = 0; j < v2.size(); j++) cur = cur * B[v2[j].second] % mod;
    d = cur;
  }
  A[v] = (b + d) % mod;
  B[v] = (a + c) % mod;
  C[v] = (a + b + d) % mod;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &second[i], &t[i]);
    g[second[i]].push_back(i);
    g[t[i]].push_back(i);
  }
  dfs(1);
  printf("%lld", C[1]);
  return 0;
}
