#include <bits/stdc++.h>
using namespace std;
vector<int> vec[300005];
long long int dp[300005][3];
void dfs(int v = 0, int p = -1) {
  dp[v][0] = 0;
  dp[v][1] = 0;
  dp[v][2] = 1;
  for (int i = 0; i < vec[v].size(); i++) {
    int to = vec[v][i];
    if (to != p) {
      dfs(to, v);
      long long int a =
          dp[v][0] * ((dp[to][1] * 2LL + dp[to][2]) % 998244353) % 998244353 +
          dp[v][2] * dp[to][1] % 998244353;
      long long int b =
          (dp[v][0] + dp[v][2]) % 998244353 *
              ((dp[to][0] + dp[to][2]) % 998244353) % 998244353 +
          dp[v][1] * ((dp[to][1] * 2LL + dp[to][2]) % 998244353) % 998244353;
      long long int c =
          dp[v][2] * ((dp[to][1] + dp[to][2]) % 998244353) % 998244353;
      dp[v][0] = a % 998244353;
      dp[v][1] = b % 998244353;
      dp[v][2] = c % 998244353;
    }
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    a--;
    b--;
    vec[a].push_back(b);
    vec[b].push_back(a);
  }
  dfs();
  printf("%lld\n", (dp[0][1] + dp[0][2]) % 998244353);
  return 0;
}
