#include <bits/stdc++.h>
using namespace std;
const int MAXN = 300100;
const int mod = 998244353;
vector<long long> w[MAXN];
long long dp[MAXN][3];
bool flag[MAXN];
int n;
long long inv(long long x) {
  long long ans = 1;
  for (long long i = mod - 2; i; i >>= 1, x = x * x % mod)
    if (i & 1) ans = ans * x % mod;
  return ans;
}
void dfs(int v) {
  vector<long long> temp;
  temp.clear();
  int cnt = 0;
  for (int i = 0; i < w[v].size(); i++) {
    if (flag[w[v][i]] == 0) {
      temp.push_back(w[v][i]);
      cnt++;
      flag[w[v][i]] = 1;
      dfs(w[v][i]);
    }
  }
  if (cnt == 0) {
    dp[v][0] = 1;
    dp[v][1] = 1;
    dp[v][2] = 0;
    return;
  } else {
    long long t = 1;
    long long inc = 1;
    dp[v][1] = 1;
    long long all = 1;
    for (int j = 0; j < temp.size(); j++)
      all = (all * (dp[temp[j]][0] + dp[temp[j]][2])) % mod;
    for (int i = 0; i < temp.size(); i++) {
      inc = 1;
      t = (t * dp[temp[i]][0]) % mod;
      inc = (all * inv(dp[temp[i]][0] + dp[temp[i]][2])) % mod;
      inc = (inc * dp[temp[i]][1]) % mod;
      dp[v][0] = (dp[v][0] + inc) % mod;
      dp[v][2] = (dp[v][2] + inc) % mod;
      dp[v][1] = (dp[v][1] * (dp[temp[i]][0] + dp[temp[i]][2])) % mod;
    }
    dp[v][0] = (dp[v][0] + t) % mod;
    return;
  }
}
int main() {
  for (int i = 0; i < MAXN; i++) w[i].clear();
  scanf("%d", &n);
  memset(dp, 0, sizeof(dp));
  memset(flag, 0, sizeof(flag));
  for (int i = 1; i < n; i++) {
    long long tx, ty;
    cin >> tx >> ty;
    w[tx].push_back(ty);
    w[ty].push_back(tx);
  }
  flag[1] = 1;
  dfs(1);
  cout << dp[1][0] << endl;
  return 0;
}
