#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
int N;
int up[maxn];
long long pre[maxn], suf[maxn];
vector<pair<int, int> > adj[maxn];
long long dp[maxn][3];
void go(int u) {
  int s = adj[u].size(), d = -1;
  if (s == 1 && u != 1) {
    dp[u][0] = 0;
    dp[u][1] = 1;
    dp[u][2] = 1;
    return;
  }
  vector<pair<int, int> > now = adj[u];
  pre[0] = suf[s] = 1;
  for (int i = 0; i < s; i++) {
    if (now[i].second == up[u]) {
      d = i;
      pre[i + 1] = pre[i];
      continue;
    }
    pre[i + 1] =
        pre[i] * (dp[now[i].second][1] + dp[now[i].second][0]) % 998244353LL;
  }
  for (int i = s - 1; i >= 0; i--) {
    if (i == d) {
      suf[i] = suf[i + 1];
      continue;
    }
    suf[i] = suf[i + 1] * (dp[now[i].second][2] + dp[now[i].second][0]) %
             998244353LL;
  }
  for (int i = 0; i < d; i++) {
    dp[u][0] +=
        pre[i] * dp[now[i].second][2] % 998244353LL * suf[i + 1] % 998244353LL;
  }
  dp[u][0] %= 998244353LL;
  dp[u][1] = pre[d] * suf[d + 1] % 998244353LL;
  for (int i = d + 1; i < s; i++) {
    dp[u][2] +=
        pre[i] * dp[now[i].second][2] % 998244353LL * suf[i + 1] % 998244353LL;
  }
  dp[u][2] = (dp[u][2] + pre[s]) % 998244353LL;
  return;
}
void DFS(int u, int par) {
  sort(adj[u].begin(), adj[u].end());
  for (pair<int, int> v : adj[u]) {
    if (v.second == par) continue;
    up[v.second] = u;
    DFS(v.second, u);
  }
  go(u);
}
int main() {
  scanf("%d", &N);
  int u, v;
  for (int i = 1; i < N; i++) {
    scanf("%d %d", &u, &v);
    adj[u].emplace_back(i, v);
    adj[v].emplace_back(i, u);
  }
  DFS(1, 0);
  printf("%lld", dp[1][2]);
}
