#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
const lint MOD = 998244353;
const int MAX_N = 3e5;
vector<int> G[MAX_N];
lint dp[MAX_N][3];
lint powmod(lint x, lint n) {
  lint ret = 1;
  while (n) {
    if (n & 1) ret = (ret * x) % MOD;
    x = (x * x) % MOD;
    n >>= 1;
  }
  return ret;
}
void dfs(int cur, int par) {
  lint &cur0 = dp[cur][0];
  lint &cur1 = dp[cur][1];
  lint &cur2 = dp[cur][2];
  cur0 = 1;
  cur1 = 1;
  for (int nxt : G[cur]) {
    if (nxt != par) {
      dfs(nxt, cur);
      cur0 = (cur0 * dp[nxt][0]) % MOD;
      cur1 = (cur1 * (dp[nxt][0] + dp[nxt][2])) % MOD;
    }
  }
  for (int nxt : G[cur]) {
    if (nxt != par) {
      cur2 =
          (cur2 +
           ((powmod((dp[nxt][0] + dp[nxt][2]) % MOD, MOD - 2) * cur1) % MOD) *
               dp[nxt][1]) %
          MOD;
    }
  }
  cur0 = (cur0 + cur2) % MOD;
}
int main(void) {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  int N;
  cin >> N;
  N--;
  while (N--) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    G[u].push_back(v), G[v].push_back(u);
  }
  dfs(0, -1);
  cout << dp[0][0] << endl;
}
