#include <bits/stdc++.h>
using namespace std;
const long long int mod = 998244353LL;
long long int n, dp[300005][2], store[300005];
vector<long long int> g[300005];
bool done[300005][2];
long long int mod_pow(long long int base) {
  long long int ret = 1, exp = mod - 2;
  while (exp) {
    if (exp % 2) ret = (ret * base) % mod;
    exp = exp >> 1;
    base = (base * base) % mod;
  }
  return ret;
}
long long int solve(long long int st, long long int pr, long long int conn) {
  if (done[st][conn]) return dp[st][conn];
  done[st][conn] = 1;
  long long int &ret = dp[st][conn];
  long long int prod = 1;
  store[st] = 1;
  for (long long int v : g[st])
    if (v != pr) {
      solve(v, st, 0);
      solve(v, st, 1);
      prod = (prod * dp[v][0]) % mod;
      store[st] = (store[st] * (dp[v][0] + dp[v][1])) % mod;
    }
  if (!conn) ret = prod;
  for (long long int v : g[st])
    if (v != pr) {
      long long int cur = (dp[v][0] + dp[v][1]) % mod;
      cur = (mod_pow(cur) * store[st]) % mod;
      cur = (cur * store[v]) % mod;
      ret = (ret + cur) % mod;
    }
  return ret;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (long long int i = 1; i <= n - 1; ++i) {
    long long int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  cout << solve(1, 1, 0);
}
