#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 9, mod = 998244353;
long long n, dp[N][3], f1[N], x, y;
vector<int> g[N];
int dfs(int x, int par) {
  dp[x][2] = dp[x][1] = 1;
  long long men = 1, ans1 = 1;
  for (long long i = g[x].size() - 1; i >= 0; i--) {
    if (g[x][i] != par) {
      dfs(g[x][i], x);
      f1[g[x][i]] = ans1;
      ans1 *= (dp[g[x][i]][2] + dp[g[x][i]][0] * 2);
      ans1 %= mod;
    }
  }
  for (long long i = 0; i < g[x].size(); i++) {
    if (g[x][i] != par) {
      dp[x][0] =
          (dp[x][0] + (((dp[x][1] * (dp[g[x][i]][1] + dp[g[x][i]][2])) % mod) *
                       f1[g[x][i]])) %
          mod;
      dp[x][2] *= (dp[g[x][i]][2] + dp[g[x][i]][0]);
      dp[x][2] %= mod;
      dp[x][1] *= (dp[g[x][i]][2] + dp[g[x][i]][0] * 2);
      dp[x][1] %= mod;
      men *= (dp[g[x][i]][2] + dp[g[x][i]][0]);
      men %= mod;
    }
  }
  dp[x][1] = (dp[x][1] - men + mod) % mod;
}
int main() {
  cin >> n;
  if (n == 1) {
    cout << 1;
    return 0;
  }
  for (long long i = 1; i < n; i++) {
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs(1, 0);
  cout << (dp[1][0] + dp[1][2]) % mod;
}
