#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1);
const long double eps = 0.0000000001;
const long long INF = 0x3fffffffffffffff;
const long long MOD = 998244353;
long long n, fa[300005], a, b, dp[300005][3];
vector<long long> son[300005];
void init(long long now) {
  for (long long i = 0; i < (long long)son[now].size(); ++i) {
    if (fa[now] == son[now][i]) {
      swap(son[now][i], son[now].back());
      son[now].pop_back();
      --i;
      continue;
    }
    fa[son[now][i]] = now;
    init(son[now][i]);
  }
}
void dfs(long long now) {
  dp[now][0] = 1;
  for (auto i : son[now]) {
    dfs(i);
  }
  for (auto i : son[now]) {
    dp[now][2] = dp[now][0] * (dp[i][0] + dp[i][1]) +
                 dp[now][1] * (dp[i][0] + dp[i][1]) +
                 dp[now][2] * (dp[i][0] + dp[i][2] * 2);
    dp[now][1] = dp[now][0] * dp[i][2] + dp[now][1] * (dp[i][0] + dp[i][2] * 2);
    dp[now][0] = dp[now][0] * (dp[i][0] + dp[i][2]);
    dp[now][0] %= MOD;
    dp[now][1] %= MOD;
    dp[now][2] %= MOD;
  }
}
signed main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (long long i = 1; i < n; ++i) {
    cin >> a >> b;
    son[a].push_back(b);
    son[b].push_back(a);
  }
  init(1);
  dfs(1);
  cout << (dp[1][0] + dp[1][2]) % MOD << endl;
  return 0;
}
