#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
struct Edge {
  int v, next;
} edge[300010 * 2];
int e, ft[300010];
int n;
long long dp[300010][3];
bool flag[300010];
void init_graph() {
  e = 0;
  memset(ft, -1, sizeof(ft));
}
void add_edge(int u, int v) {
  edge[e].v = v;
  edge[e].next = ft[u];
  ft[u] = e++;
}
void dfs(int u) {
  flag[u] = true;
  dp[u][0] = 1;
  dp[u][1] = 0;
  dp[u][2] = 0;
  long long c[3];
  for (int i = ft[u]; i != -1; i = edge[i].next) {
    int v = edge[i].v;
    if (flag[v]) continue;
    dfs(v);
    c[0] = c[1] = c[2] = 0;
    for (int j = 0; j < 3; j++) {
      for (int k = 0; k < 3; k++) {
        if (k != 1) c[j] += dp[u][j] * dp[v][k] % mod;
        if ((j != 2 && k != 2) || (j == 2 && k == 2)) {
          c[2] += dp[u][j] * dp[v][k] % mod;
        } else if ((j == 0 || j == 1) && k == 2) {
          c[1] += dp[u][j] * dp[v][k] % mod;
        }
      }
    }
    dp[u][0] = c[0] % mod;
    dp[u][1] = c[1] % mod;
    dp[u][2] = c[2] % mod;
  }
}
void solve() {
  memset(flag, false, sizeof(flag));
  dfs(1);
  long long ans = (dp[1][0] + dp[1][2]) % mod;
  cout << ans << endl;
}
int main() {
  while (cin >> n) {
    int u, v;
    init_graph();
    for (int i = 1; i < n; i++) {
      scanf("%d%d", &u, &v);
      add_edge(u, v);
      add_edge(v, u);
    }
    solve();
  }
  return 0;
}
