#include <bits/stdc++.h>
using namespace std;
long long dp[200005][4];
vector<int> v[200005];
int mod = 998244353;
void dfs(int first, int f) {
  dp[first][0] = 1;
  int visf = 0;
  for (auto it : v[first]) {
    if (it != f) {
      dfs(it, first);
      if (visf) {
        dp[first][1] *= (dp[it][0] + dp[it][2] + dp[it][1]);
        dp[first][1] %= mod;
        dp[first][2] = (dp[first][2] * (dp[it][0] + dp[it][1] + dp[it][2]) +
                        dp[first][0] * (dp[it][2] + dp[it][0])) %
                       mod;
        dp[first][3] *= (dp[it][0] + dp[it][1] + dp[it][2]);
        dp[first][3] %= mod;
      } else {
        dp[first][1] = (dp[first][1] * (dp[it][0] + dp[it][1] + dp[it][2]) +
                        dp[first][0] * (dp[it][2] + dp[it][0])) %
                       mod;
      }
      dp[first][0] *= (dp[it][1] + dp[it][3]);
      dp[first][0] %= mod;
    } else {
      visf = 1;
      dp[first][3] = dp[first][0];
    }
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int first, second;
    scanf("%d %d", &first, &second);
    v[first].push_back(second);
    v[second].push_back(first);
  }
  dfs(1, 0);
  printf("%lld\n", (dp[1][0] + dp[1][1] + dp[1][2] + dp[1][3]) % mod);
}
