#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
const int maxN = 300 * 1000 + 10;
int n;
long long d1[maxN], d2[maxN], d3[maxN];
vector<int> g[maxN];
void dfs(int x, int p = -1) {
  vector<int> child;
  for (auto y : g[x])
    if (y != p) dfs(y, x), child.push_back(y);
  vector<long long> free, freeT;
  free.push_back(1);
  freeT.push_back(1);
  for (auto y : child)
    free.push_back(free.back() * ((2 * d2[y] + d3[y]) % mod) % mod);
  reverse(child.begin(), child.end());
  for (auto y : child)
    freeT.push_back(freeT.back() * ((2 * d2[y] + d3[y]) % mod) % mod);
  reverse(child.begin(), child.end());
  d1[x] = free.back();
  int cnt = 0;
  for (auto y : child) {
    long long others = free[cnt] * freeT[(int)child.size() - cnt - 1] % mod;
    d2[x] = (d2[x] + others * d1[y] % mod) % mod;
    cnt++;
  }
  d3[x] = 1;
  for (auto y : child) d3[x] = d3[x] * ((d2[y] + d3[y]) % mod) % mod;
}
int main() {
  cin >> n;
  for (int i = 0, x, y; i < n - 1; i++) {
    cin >> x >> y, x--, y--;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs(0);
  cout << (d3[0] + d2[0]) % mod << endl;
  return 0;
}
