#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 7;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int mod = 998244353;
const double eps = 1e-8;
const double PI = acos(-1);
template <class T, class S>
inline void add(T& a, S b) {
  a += b;
  if (a >= mod) a -= mod;
}
template <class T, class S>
inline void sub(T& a, S b) {
  a -= b;
  if (a < 0) a += mod;
}
template <class T, class S>
inline bool chkmax(T& a, S b) {
  return a < b ? a = b, true : false;
}
template <class T, class S>
inline bool chkmin(T& a, S b) {
  return a > b ? a = b, true : false;
}
int n;
vector<int> G[N];
long long power(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ans;
}
long long dp[N][3];
void go(int u, int fa) {
  int pos = -1;
  for (int i = 0; i < ((int)G[u].size()); i++) {
    if (G[u][i] == fa) {
      pos = i;
      continue;
    }
    go(G[u][i], u);
  }
  if (~pos) {
    swap(G[u][pos], G[u][((int)G[u].size()) - 1]);
    G[u].pop_back();
  }
}
void dfs(int u) {
  dp[u][0] = 1;
  dp[u][1] = 0;
  dp[u][2] = 1;
  if (!((int)G[u].size())) return;
  for (auto& v : G[u]) dfs(v);
  int cnts = ((int)G[u].size());
  vector<long long> prefix[3];
  for (int i = 0; i < 3; i++) {
    prefix[i].resize(cnts);
    for (int j = 0; j < cnts; j++) {
      int v = G[u][j];
      if (!j)
        prefix[i][j] = dp[v][i];
      else
        prefix[i][j] = prefix[i][j - 1] * dp[v][i] % mod;
    }
  }
  vector<long long> prefix01(cnts);
  vector<long long> suffix01(cnts);
  for (int i = 0; i < cnts; i++) {
    int v = G[u][i];
    if (!i)
      prefix01[i] = (dp[v][0] + dp[v][1]) % mod;
    else
      prefix01[i] = prefix01[i - 1] * (dp[v][0] + dp[v][1]) % mod;
  }
  for (int i = cnts - 1; i >= 0; i--) {
    int v = G[u][i];
    if (i == cnts - 1)
      suffix01[i] = (dp[v][0] + dp[v][1]) % mod;
    else
      suffix01[i] = suffix01[i + 1] * (dp[v][0] + dp[v][1]) % mod;
  }
  dp[u][0] = prefix[0][cnts - 1];
  for (int i = 0; i < cnts; i++) {
    int v = G[u][i];
    long long tmp = dp[v][2];
    if (i - 1 >= 0) tmp = tmp * prefix01[i - 1] % mod;
    if (i + 1 < cnts) tmp = tmp * suffix01[i + 1] % mod;
    add(dp[u][0], tmp);
    add(dp[u][1], tmp);
  }
  dp[u][2] = prefix01[cnts - 1];
}
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);
  }
  go(1, 0);
  dfs(1);
  printf("%lld\n", dp[1][0]);
  return 0;
}
