#include <bits/stdc++.h>
using namespace std;
int n;
long long dp[300005][3], g[3];
vector<int> G[300005];
void dfs(int u, int fa) {
  dp[u][0] = 1;
  for (int i = 0; i < G[u].size(); i++) {
    int v = G[u][i];
    if (v == fa) continue;
    dfs(v, u);
    g[0] = dp[u][0] * (dp[v][2] + dp[v][0]) % 998244353;
    g[1] = (dp[u][0] * dp[v][2] % 998244353 +
            (dp[u][1] * (dp[v][0] + dp[v][2] * 2) % 998244353) % 998244353) %
           998244353;
    g[2] = (dp[u][0] * (dp[v][0] + dp[v][1]) % 998244353 +
            dp[u][1] * (dp[v][0] + dp[v][1]) % 998244353 +
            dp[u][2] * (dp[v][0] + dp[v][2] * 2) % 998244353) %
           998244353;
    dp[u][0] = g[0];
    dp[u][1] = g[1];
    dp[u][2] = g[2];
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  dfs(1, 0);
  printf("%lld\n", (dp[1][0] + dp[1][2]) % 998244353);
}
