#include <bits/stdc++.h>
using namespace std;
vector<int> edge[220000];
int u[220000];
int v[220000];
int n;
long long dp[220000][5];
long long dfs(long long x, long long last = -1) {
  int laste = (1 << 29);
  for (auto e : edge[x]) {
    int to = u[e] + v[e] - x;
    if (to == last) {
      laste = e;
      continue;
    }
    dfs(to, x);
  }
  long long dp0n, dp0u, dp1, dp2, dp3n, dp3u, dp4;
  long long not_used = 1;
  long long used = 0;
  for (auto e : edge[x]) {
    int to = u[e] + v[e] - x;
    if (e < laste) {
      used *= dp[to][3] + dp[to][4];
      used %= 998244353;
      used += not_used * dp[to][0];
      used %= 998244353;
      not_used *= dp[to][1] + dp[to][2];
      not_used %= 998244353;
    }
    if (e == laste) {
      dp0n = not_used;
      dp0u = 0;
      dp1 = not_used;
      dp2 = used;
      dp3n = not_used;
      dp3u = 0;
      dp4 = used;
    }
    if (e > laste) {
      dp0u *= dp[to][3] + dp[to][4];
      dp0u %= 998244353;
      dp0u += dp0n * dp[to][0];
      dp0u %= 998244353;
      dp0n *= dp[to][1] + dp[to][2];
      dp0n %= 998244353;
      dp3u *= dp[to][3] + dp[to][4];
      dp3u %= 998244353;
      dp3u += dp3n * dp[to][0];
      dp3u %= 998244353;
      dp3n *= dp[to][1] + dp[to][2];
      dp3n %= 998244353;
      dp1 *= dp[to][3] + dp[to][4];
      dp1 %= 998244353;
      dp2 *= dp[to][3] + dp[to][4];
      dp2 %= 998244353;
      dp4 *= dp[to][3] + dp[to][4];
      dp4 %= 998244353;
    }
  }
  dp[x][0] = (dp0u + dp0n) % 998244353;
  dp[x][1] = dp1;
  dp[x][2] = dp2;
  dp[x][3] = (dp3u + dp3n) % 998244353;
  dp[x][4] = dp4;
  return (used + not_used) % 998244353;
}
int main() {
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    cin >> u[i] >> v[i];
    edge[u[i]].push_back(i);
    edge[v[i]].push_back(i);
  }
  cout << dfs(1) << endl;
  return 0;
}
