#include <bits/stdc++.h>
using namespace std;
inline void read(int &x) {
  x = 0;
  char c = getchar();
  int f = 1;
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  x *= f;
}
inline unsigned int R() {
  static unsigned int seed = 416;
  return seed ^= seed >> 5, seed ^= seed << 17, seed ^= seed >> 13;
}
const int N = 606000, mo = 998244353;
int n, f[N][2][2];
vector<int> e[N];
void add(int &x, long long y) { x = (x + y) % mo; }
void dfs(int u, int fa) {
  f[u][1][0] = 1;
  for (register int t = 0; t <= ((int)e[u].size()) - 1; t++)
    if (e[u][t] != fa) {
      int v = e[u][t];
      dfs(e[u][t], u);
      int a[2][2];
      for (register int i = 0; i <= 1; i++)
        for (register int j = 0; j <= 1; j++)
          a[i][j] = f[u][i][j], f[u][i][j] = 0;
      for (register int i = 0; i <= 1; i++)
        for (register int j = 0; j <= 1; j++) {
          add(f[u][i][j], 1LL * a[i][j] * (f[v][0][0] + f[v][0][1]));
          add(f[u][i][1], 1LL * a[i][j] * (f[v][0][0] + f[v][0][1]));
        }
      for (register int i = 0; i <= 1; i++)
        add(f[u][0][1], 1LL * a[1][i] * (f[v][1][1] + f[v][1][0]));
      for (register int i = 0; i <= 1; i++)
        for (register int j = 0; j <= 1; j++)
          add(f[u][i][j], 1LL * a[i][j] * f[v][1][0]);
    }
}
int main() {
  read(n);
  for (register int i = 1; i <= n - 1; i++) {
    int u, v;
    read(u);
    read(v);
    e[u].push_back(v);
    e[v].push_back(u);
  }
  dfs(1, 0);
  printf("%lld", (1LL * f[1][1][0] + f[1][0][0] + f[1][0][1]) % mo);
  return 0;
}
