#include <bits/stdc++.h>
using namespace std;
vector<long long> edge[300005];
long long u, v, cd, f[300005][4], mod = 998244353;
void inp() {
  cin >> cd;
  for (long long i = 1; i < cd; i++)
    cin >> u >> v, edge[u].push_back(v), edge[v].push_back(u);
}
void dp(long long u, long long p) {
  long long ok = 0, left = 0, k = 1;
  f[u][2] = 1;
  for (int i = 0; i < edge[u].size(); i++) {
    int v = edge[u][i];
    if (v == p) continue;
    dp(v, u);
    ok++;
    if (ok == 1)
      f[u][1] = (f[v][0] + f[v][2]);
    else {
      f[u][1] *= (f[v][1] + f[v][3]) % mod;
      f[u][1] %= mod;
      f[u][1] += left * (f[v][0] + f[v][2]) % mod;
      f[u][1] %= mod;
    }
    if (ok == 1)
      left = (f[v][1] + f[v][3]) % mod;
    else
      left *= (f[v][1] + f[v][3]) % mod, left %= mod;
    if (ok == 1)
      f[u][0] = (f[v][1] + f[v][3]) % mod;
    else
      f[u][0] *= (f[v][1] + f[v][3]) % mod, f[u][0] %= mod;
    f[u][2] *= f[v][3], f[u][2] %= mod;
  }
  f[u][0] += mod * 2, f[u][0] -= f[u][2], f[u][0] %= mod;
  f[u][3] = (f[u][1] + f[u][2]) % mod;
  if (ok == 0) f[u][2] = f[u][3] = 1, f[u][0] = f[u][1] = 0;
}
void do_it() {
  dp(1, 0);
  cout << f[1][3];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  inp(), do_it();
}
