#include <bits/stdc++.h>
using namespace std;
const int OO = 1e9;
const long long INF = 1e18;
const int irand(int lo, int hi) {
  return ((double)rand() / (RAND_MAX + 1.0)) * (hi - lo + 1) + lo;
}
const long long lrand(long long lo, long long hi) {
  return ((double)rand() / (RAND_MAX + 1.0)) * (hi - lo + 1) + lo;
}
template <typename T>
T getnum() {
  int sign = 1;
  T ret = 0;
  char c;
  do {
    c = getchar();
  } while (c == ' ' || c == '\n');
  if (c == '-')
    sign = -1;
  else
    ret = c - '0';
  while (1) {
    c = getchar();
    if (c < '0' || c > '9') break;
    ret = 10 * ret + c - '0';
  }
  return sign * ret;
}
inline void ini(int& x) { x = getnum<int>(); }
inline void scani(int& x) { scanf("%d", &x); }
const long long MOD = 998244353;
inline long long addmod(long long a, long long b) { return (a + b) % MOD; }
inline long long mulmod(long long a, long long b) { return (a * b) % MOD; }
inline long long expmod(long long a, long long e) {
  long long ret = 1;
  while (e) {
    if (e & 1) ret = mulmod(ret, a);
    a = mulmod(a, a);
    e >>= 1;
  }
  return ret;
}
inline long long divmod(long long a, long long b) {
  return mulmod(a, expmod(b, MOD - 2));
}
const int N = 3e5 + 5;
int n;
vector<int> lst[N];
int memo[N][3];
int dp(int now, int state, int par) {
  int& ret = memo[now][state];
  if (ret != -1) return ret;
  ret = 0;
  int total = 1;
  for (int i = 0; i < lst[now].size(); i++) {
    int to = lst[now][i];
    if (to == par) continue;
    total = mulmod(total, addmod(dp(to, 0, now), dp(to, 2, now)));
  }
  if (state != 1) {
    for (int i = 0; i < lst[now].size(); i++) {
      int to = lst[now][i];
      if (to == par) continue;
      int tmp = divmod(total, addmod(dp(to, 0, now), dp(to, 2, now)));
      tmp = mulmod(tmp, dp(to, 1, now));
      ret = addmod(ret, tmp);
    }
  }
  if (state == 1) {
    ret = addmod(ret, total);
  } else if (state == 0) {
    int tmp = 1;
    for (int i = 0; i < lst[now].size(); i++) {
      int to = lst[now][i];
      if (to == par) continue;
      tmp = mulmod(tmp, dp(to, 0, now));
    }
    ret = addmod(ret, tmp);
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout.setf(ios::fixed);
  cout.setf(ios::showpoint);
  cout.precision(10);
  cin >> n;
  for (int i = 1; i <= n - 1; i += 1) {
    int a, b;
    cin >> a >> b;
    lst[a].push_back(b);
    lst[b].push_back(a);
  }
  memset(memo, -1, sizeof memo);
  cout << dp(1, 0, -1) << '\n';
  return 0;
}
