#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
constexpr auto MOD = 998244353LL;
constexpr auto LINF = (1LL << 60);
constexpr auto INF = 2147483647LL;
constexpr auto PI = 3.1415926535897932384626433;
constexpr auto EPS = 1E-9;
template <typename T1, typename T2>
ostream& operator<<(ostream& out, const pair<T1, T2> p) {
  out << p.first << ' ' << p.second;
  return out;
}
template <typename T1, typename T2>
istream& operator>>(istream& in, pair<T1, T2>& p) {
  in >> p.first >> p.second;
  return in;
}
template <typename T>
istream& operator>>(istream& in, vector<T>& v) {
  for (auto& x : v) in >> x;
  return in;
}
template <typename T>
ostream& operator<<(ostream& out, vector<T> v) {
  for (int i = 0; i < v.size(); i++)
    out << v[i] << (i + 1 == v.size() ? '\n' : ' ');
  out.flush();
  return out;
}
int n;
ll dp[300010][3];
vi e[300010];
ll pwr(ll b, ll e) {
  b %= MOD;
  if (e == 0) return 1;
  if (e == 1) return b;
  return (pwr(b * b, e / 2) * pwr(b, e % 2)) % MOD;
}
void dfs(int now, int prv) {
  dp[now][0] = 1;
  for (auto x : e[now])
    if (x - prv) dfs(x, now);
  ll ways =
      accumulate(e[now].begin(), e[now].end(), 1LL, [&prv](ll acc, int x) {
        if (x == prv) return acc;
        return acc * (dp[x][1] * 2 + dp[x][0]) % MOD;
      });
  dp[now][0] =
      accumulate(e[now].begin(), e[now].end(), 1LL, [&prv](ll acc, int x) {
        if (x == prv) return acc;
        return acc * (dp[x][0] + dp[x][1]) % MOD;
      });
  dp[now][2] = ways - dp[now][0];
  dp[now][2] %= MOD;
  if (e[now].size() - (now != prv)) {
    dp[now][1] = accumulate(
        e[now].begin(), e[now].end(), 0LL, [&prv, &ways](ll acc, int x) {
          if (x == prv) return acc;
          ll others = ways * pwr(dp[x][1] * 2 + dp[x][0], MOD - 2) % MOD;
          return (acc + others * (dp[x][2] + dp[x][0]) % MOD) % MOD;
        });
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 1, u, v; i < n; i++) {
    cin >> u >> v;
    e[u].push_back(v);
    e[v].push_back(u);
  }
  dfs(1, 1);
  ll res = accumulate(dp[1], dp[1] + 3, 0LL) - dp[1][2];
  res %= MOD;
  if (res < 0) res += MOD;
  cout << res << endl;
  return 0;
}
