#include <bits/stdc++.h>
using namespace std;
int mult(int a, int b) { return (1LL * a * b) % 998244353; }
vector<int> g[300030];
int ans[300030][3];
void dfs(int p, int u) {
  ans[u][0] = 1;
  vector<int> all;
  all.push_back(0);
  for (int i = 0; i < g[u].size(); i++) {
    int to = g[u][i];
    if (to == p) continue;
    dfs(u, g[u][i]);
    ans[u][0] = mult(ans[u][0], ans[to][0] + ans[to][1]);
    all.push_back(to);
  }
  all.push_back(0);
  vector<int> num;
  num.push_back(1);
  for (int i = 1; i + 1 < all.size(); i++)
    num.push_back(
        mult(num.back(), ans[all[i]][0] + (2LL * ans[all[i]][1]) % 998244353));
  vector<int> rev;
  reverse(all.begin(), all.end());
  rev.push_back(1);
  for (int i = 1; i + 1 < all.size(); i++)
    rev.push_back(
        mult(rev.back(), ans[all[i]][0] + (2LL * ans[all[i]][1]) % 998244353));
  reverse(rev.begin(), rev.end());
  reverse(all.begin(), all.end());
  for (int i = 1; i + 1 < all.size(); i++) {
    int now = mult(num[i - 1], rev[i]);
    now = mult(now, ans[all[i]][2]);
    ans[u][1] = (ans[u][1] + now) % 998244353;
  }
  ans[u][2] = rev[0];
}
int n, x, y, i;
int main() {
  cin >> n;
  for (i = 1; i < n; i++) {
    scanf("%d%d", &x, &y);
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs(0, 1);
  cout << (ans[1][0] + ans[1][1]) % 998244353 << endl;
}
