#include <bits/stdc++.h>
using namespace std;
long long n;
vector<long long> v[65536 * 5];
long long dp[65536 * 5][4];
long long qpow(long long x, long long y) {
  long long res = 1;
  x %= 998244353;
  while (y) {
    if (y & 1) res = 1ll * res * x % 998244353;
    x = 1ll * x * x % 998244353;
    y = y / 2;
  }
  return res;
}
void dfs(long long x, long long p) {
  long long pr1 = 1;
  dp[x][3] = 1;
  long long pr2 = 1;
  for (long long i = 0; i < v[x].size(); i++) {
    long long y = v[x][i];
    if (y != p)
      dfs(y, x);
    else
      continue;
    pr1 = 1ll * pr1 * (dp[y][1] + dp[y][2]) % 998244353;
    dp[x][3] =
        1ll * dp[x][3] * (1ll * dp[y][1] + 1ll * dp[y][2] * 2) % 998244353;
  }
  pr2 = dp[x][3];
  dp[x][1] = pr1;
  dp[x][3] -= pr1;
  dp[x][3] %= 998244353;
  for (long long i = 0; i < v[x].size(); i++) {
    long long y = v[x][i];
    if (y == p) continue;
    dp[x][2] += 1ll * pr2 *
                qpow(1ll * dp[y][1] + 1ll * dp[y][2] * 2, 998244353 - 2) %
                998244353 * (dp[y][3] + dp[y][1]) % 998244353;
    dp[x][2] %= 998244353;
  }
}
int main() {
  scanf("%lld", &n);
  for (long long i = 1; i < n; i++) {
    long long x, y;
    scanf("%lld%lld", &x, &y);
    v[x].push_back(y);
    v[y].push_back(x);
  }
  dfs(1, 0);
  cout << (1ll * dp[1][1] + dp[1][2] + 998244353 * 3ll) % 998244353;
  return 0;
}
