#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
const long double PI = 3.14159265358979323846;
const long double eps = 1e-5;
const int INF = numeric_limits<int>::max();
const long long LINF = numeric_limits<long long>::max();
const long long mod = 998244353;
long long power(long long x, long long n) {
  long long res = 1;
  while (n) {
    if (n & 1) res = (res * x) % mod;
    x = (x * x) % mod;
    n /= 2;
  }
  return res;
}
long long inv(long long x) { return power(x, mod - 2); }
int n;
vector<vector<int> > g;
vector<long long> d0, d1, d;
void dfs(int pos, int p) {
  d0[pos] = 0;
  d1[pos] = 1;
  d[pos] = 1;
  long long m0 = 1;
  for (int i = 0; i < g[pos].size(); ++i) {
    int to = g[pos][i];
    if (to == p) continue;
    dfs(to, pos);
    m0 = (m0 * (d[to] + d0[to])) % mod;
  }
  for (int i = 0; i < g[pos].size(); ++i) {
    int to = g[pos][i];
    if (to == p) continue;
    d0[pos] = (d0[pos] + ((m0 * d1[to]) % mod) * inv(d[to] + d0[to])) % mod;
    d[pos] = (d[pos] * d[to]) % mod;
    d1[pos] = (d1[pos] * (d0[to] + d[to])) % mod;
  }
  d[pos] += d0[pos];
  d[pos] %= mod;
}
void solve() {
  cin >> n;
  g.resize(n);
  int a, b;
  for (int i = 0; i < n - 1; ++i) {
    cin >> a >> b;
    --a, --b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  d0.assign(n, 0);
  d1.assign(n, 0);
  d.assign(n, 0);
  dfs(0, -1);
  cout << d[0] << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  solve();
  return 0;
}
