#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
int n, x, y;
vector<int> g[300005];
int dp[300005][3];
void dfs(int nod, int tata) {
  dp[nod][0] = dp[nod][1] = 0;
  dp[nod][2] = 1;
  for (auto i : g[nod]) {
    if (i != tata) {
      dfs(i, nod);
      int a = dp[nod][0], b = dp[nod][1], c = dp[nod][2];
      int x = dp[i][0], y = dp[i][1], z = dp[i][2];
      dp[nod][2] = (1LL * c * (y + z)) % MOD;
      dp[nod][0] = (1LL * (a + c) * y + 1LL * a * (y + z)) % MOD;
      dp[nod][1] = ((1LL * c * (x + z) % MOD + 1LL * b * (2LL * y + z)) % MOD +
                    1LL * a * (x + z)) %
                   MOD;
    }
  }
}
int main() {
  cin >> n;
  for (int i = 1; i < n; i++) {
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs(1, 0);
  cout << (dp[1][1] + dp[1][2]) % MOD;
  return 0;
}
