#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using ld = long double;
const int MOD = 998244353;
void add(int& x, int y) { ((x += y) >= MOD) && (x -= MOD); }
int mul(int x, int y) { return x * 1ll * y % MOD; }
const int MAXN = 3e5 + 10;
int n;
vi g[MAXN];
bool read() {
  if (!(cin >> n)) {
    return 0;
  }
  for (int i = 0; i < int(n); ++i) {
    g[i].clear();
  }
  for (int it = 0; it < int(n - 1); ++it) {
    int a, b;
    cin >> a >> b;
    --a;
    --b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  return 1;
}
int dp[MAXN][3];
void dfs(int v, int p) {
  vi sons;
  for (int to : g[v]) {
    if (to == p) {
      continue;
    }
    sons.push_back(to);
    dfs(to, v);
  }
  vvi d(2, vi(2, 0));
  d[0][0] = 1;
  for (int to : sons) {
    vvi nd(2, vi(2, 0));
    for (int was1 = 0; was1 < int(2); ++was1) {
      for (int was2 = 0; was2 < int(2); ++was2) {
        for (int now = 0; now < int(3); ++now) {
          int nwas1 = was1 || (now == 1);
          if (now == 1 && was1) {
            continue;
          }
          int nwas2 = was2 || (now == 2);
          int cur = mul(d[was1][was2], dp[to][now]);
          add(nd[nwas1][nwas2], cur);
        }
      }
    }
    d.swap(nd);
  }
  for (int was2 = 0; was2 < int(2); ++was2) {
    add(dp[v][0], d[1][was2]);
  }
  add(dp[v][0], d[0][0]);
  for (int was2 = 0; was2 < int(2); ++was2) {
    add(dp[v][1], d[0][was2]);
  }
  for (int was2 = 0; was2 < int(2); ++was2) {
    add(dp[v][2], d[1][was2]);
  }
}
void solve() {
  memset(dp, 0, sizeof dp);
  dfs(0, 0);
  int ans = dp[0][0];
  cout << ans << endl;
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout.tie(0);
  cout.precision(20);
  cout << fixed;
  while (read()) {
    solve();
  }
  return 0;
}
