#include <bits/stdc++.h>
using namespace std;
const int NMAX = 300010;
vector<int> adia[NMAX];
int dp[NMAX][3];
int sp_st[NMAX], sp_dr[NMAX];
void dfs(int nod, int tata) {
  if (tata) adia[nod].erase(find(adia[nod].begin(), adia[nod].end(), tata));
  dp[nod][0] = 1;
  if (adia[nod].empty()) return;
  for (auto i : adia[nod]) dfs(i, nod);
  vector<int>& v = adia[nod];
  v.push_back(0);
  swap(v[0], v.back());
  int n = v.size() - 1;
  sp_st[0] = sp_dr[n + 1] = 1;
  for (int i = 1; i <= n; i++) {
    dp[nod][0] = 1LL * dp[nod][0] * (dp[v[i]][0] + dp[v[i]][2]) % 998244353;
    sp_st[i] = sp_dr[i] = (2LL * dp[v[i]][2] + dp[v[i]][0]) % 998244353;
    sp_st[i] = 1LL * sp_st[i] * sp_st[i - 1] % 998244353;
  }
  for (int i = n; i >= 1; i--)
    sp_dr[i] = 1LL * sp_dr[i] * sp_dr[i + 1] % 998244353;
  dp[nod][1] = (sp_st[n] - dp[nod][0] + 998244353) % 998244353;
  for (int cupl = 1; cupl <= n; cupl++)
    dp[nod][2] =
        (dp[nod][2] + 1LL * sp_st[cupl - 1] * sp_dr[cupl + 1] % 998244353 *
                          (dp[v[cupl]][0] + dp[v[cupl]][1])) %
        998244353;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  while (--n) {
    int a, b;
    cin >> a >> b;
    adia[a].push_back(b);
    adia[b].push_back(a);
  }
  dfs(1, 0);
  cout << (dp[1][0] + dp[1][2]) % 998244353 << '\n';
  return 0;
}
