#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > adj(300001);
long long dp[300001][3];
void DFS(int i, int p = 0) {
  dp[i][0] = 1;
  dp[i][2] = 1;
  long long s = 1;
  for (auto j : adj[i]) {
    if (j == p) {
      continue;
    }
    DFS(j, i);
    long long a = dp[j][0] + dp[j][1], b = a + dp[j][1];
    dp[i][0] = (dp[i][0] * a) % 998244353;
    dp[i][1] = (dp[i][1] * b + s * dp[j][2]) % 998244353;
    dp[i][2] = (dp[i][2] * b) % 998244353;
    s = (s * b) % 998244353;
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int x = 1; x < n; ++x) {
    int i, j;
    scanf("%d%d", &i, &j);
    adj[i].push_back(j);
    adj[j].push_back(i);
  }
  DFS(1);
  long long ans = (dp[1][0] + dp[1][1]) % 998244353;
  printf("%lld\n", ans);
  return 0;
}
