#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
const int maxn = 2e5 + 5;
const long long mod = 998244353;
int n;
vector<int> g[maxn];
long long dp[maxn][5], a[maxn], b[maxn], c[maxn];
void dfs(int u, int fa) {
  if (g[u].size() == 1 && u != 1) {
    dp[u][1] = dp[u][3] = 1;
    return;
  }
  for (auto v : g[u]) {
    if (v == fa) continue;
    dfs(v, u);
  }
  int f = 0, m = 0;
  for (auto v : g[u]) {
    if (v == fa)
      f = m;
    else {
      a[++m] = (dp[v][0] + dp[v][1]) % mod;
      b[m] = (dp[v][2] + dp[v][3]) % mod;
      c[m] = (dp[v][0] + dp[v][2] + dp[v][3]) % mod;
    }
  }
  a[0] = c[m + 1] = 1;
  for (int i = 1; i <= m; i++) a[i] = a[i - 1] * a[i] % mod;
  for (int i = m; i; i--) c[i] = c[i + 1] * c[i] % mod;
  for (int i = 1; i <= m; i++)
    if (i <= f)
      dp[u][0] = (dp[u][0] + a[i - 1] * b[i] % mod * c[i + 1] % mod) % mod;
    else
      dp[u][2] = (dp[u][2] + a[i - 1] * b[i] % mod * c[i + 1] % mod) % mod;
  dp[u][1] = a[f] * c[f + 1] % mod;
  dp[u][3] = a[m];
}
int main() {
  scanf("%d", &n);
  for (int i = 1, u, v; i < n; i++) {
    scanf("%d%d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(1, 1);
  printf("%lld\n", (dp[1][2] + dp[1][3]) % mod);
}
