#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
const long long N = 300010;
vector<long long> v[N];
long long dp[N][3];
long long powmod(long long a, long long b) {
  long long ans = 1LL;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ans;
}
void dfs(long long u, long long father) {
  dp[u][1] = 1LL;
  dp[u][0] = 1LL;
  for (long long i = 0; i < v[u].size(); i++) {
    long long x = v[u][i];
    if (x == father) continue;
    dfs(x, u);
    dp[u][1] = dp[u][1] * (dp[x][0] + dp[x][2]) % mod;
    dp[u][0] = dp[u][0] * dp[x][0] % mod;
  }
  for (long long i = 0; i < v[u].size(); i++) {
    long long x = v[u][i];
    if (x == father) continue;
    dp[u][2] = (dp[u][2] + powmod(dp[x][0] + dp[x][2], mod - 2) * dp[u][1] %
                               mod * dp[x][1]) %
               mod;
  }
  dp[u][0] = (dp[u][0] + dp[u][2]) % mod;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  for (long long i = 1; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  dfs(1, -1);
  cout << dp[1][0] << endl;
  return 0;
}
