#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int n;
const int bign = 300033;
vector<int> eelist[bign];
const int mymod = 998244353;
long long dp[bign][5];
long long rev[bign][5];
long long getRev(long long x) {
  long long y = mymod - 2;
  long long ret = 1;
  while (y) {
    if (y & 1) {
      ret = (ret * x) % mymod;
    }
    x = (x * x) % mymod;
    y >>= 1;
  }
  return ret;
}
void dfs(int u, int ufa) {
  dp[u][0] = 1;
  dp[u][1] = 1;
  dp[u][2] = 0;
  for (int i = 0; i < eelist[u].size(); i++) {
    int v = eelist[u][i];
    if (v != ufa) {
      dfs(v, u);
      (dp[u][0] *= dp[v][0]) %= mymod;
      (dp[u][1] *= (dp[v][0] + dp[v][2])) %= mymod;
    }
  }
  for (int i = 0; i < eelist[u].size(); i++) {
    int v = eelist[u][i];
    if (v != ufa) {
      dp[u][2] +=
          dp[v][1] * dp[u][1] % mymod * getRev(dp[v][0] + dp[v][2]) % mymod;
      dp[u][2] %= mymod;
    }
  }
  dp[u][0] = (dp[u][0] + dp[u][2]) % mymod;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    eelist[u].push_back(v);
    eelist[v].push_back(u);
  }
  dfs(1, -1);
  printf("%lld\n", dp[1][0]);
}
