#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &x) {
  x = 0;
  char c = getchar();
  bool flag = false;
  while (!isdigit(c)) {
    if (c == '-') flag = true;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  if (flag) x = -x;
}
int n;
long long f[400010][3], pre[400010], suf[400010];
vector<int> ve[400010];
void dfs(int x, int fa) {
  for (int i = 0; i < ve[x].size(); ++i) {
    int y = ve[x][i];
    if (y == fa) continue;
    dfs(y, x);
  }
  int d = find(ve[x].begin(), ve[x].end(), fa) - ve[x].begin();
  if (d != ve[x].size()) ve[x].erase(ve[x].begin() + d);
  pre[0] = 1;
  for (int i = 0; i < ve[x].size(); ++i) {
    int y = ve[x][i];
    pre[i + 1] = pre[i] * (f[y][0] + f[y][1]) % 998244353;
  }
  suf[ve[x].size()] = 1;
  for (int i = ve[x].size() - 1; i >= 0; --i) {
    int y = ve[x][i];
    suf[i] = suf[i + 1] * (f[y][0] + f[y][2]) % 998244353;
  }
  f[x][1] = pre[d] * suf[d] % 998244353, f[x][2] = pre[ve[x].size()];
  for (int i = 0; i < ve[x].size(); ++i) {
    int y = ve[x][i];
    if (i < d)
      f[x][0] =
          (f[x][0] + f[y][2] * pre[i] % 998244353 * suf[i + 1] % 998244353) %
          998244353;
    else
      f[x][2] =
          (f[x][2] + f[y][2] * pre[i] % 998244353 * suf[i + 1] % 998244353) %
          998244353;
  }
}
int main() {
  read(n);
  for (int i = 1; i < n; ++i) {
    int x, y;
    read(x), read(y);
    ve[x].push_back(y), ve[y].push_back(x);
  }
  dfs(1, 0), printf("%lld", (f[1][0] + f[1][1]) % 998244353);
  return 0;
}
