#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, long long int y, long long int m);
long long int modInverse(long long int a, long long int m) {
  return power(a, m - 2, m);
}
long long int power(long long int x, long long int y, long long int m) {
  if (y == 0) return 1;
  long long int p = power(x, y / 2, m) % m;
  p = (p * p) % m;
  return (y % 2 == 0) ? p : (x * p) % m;
}
long long int visited[300001] = {0};
vector<long long int> dfs(long long int pt, vector<long long int> adj[]) {
  visited[pt] = 1;
  long long int t = adj[pt].size();
  long long int f = 1, child = 0, answith = 0, answithout1 = 1,
                answithout21 = 1, answithout22 = 1;
  vector<long long int> ans;
  vector<pair<long long int, long long int> > see;
  for (long long int i = 0; i < t; i++) {
    long long int ne = adj[pt][i];
    if (visited[ne] == 0) {
      child++;
      vector<long long int> ans = dfs(ne, adj);
      answithout1 = (answithout1 * ((ans[0] + ans[1]) % 998244353)) % 998244353;
      answithout21 =
          (answithout21 * ((2 * ans[0] + ans[1]) % 998244353)) % 998244353;
      answithout22 =
          (answithout22 * ((ans[0] + ans[1]) % 998244353)) % 998244353;
      long long int x1 = (ans[1] + ans[2]) % 998244353;
      long long int x2 = (2 * ans[0] + ans[1]) % 998244353;
      f = (f * x2) % 998244353;
      see.push_back(make_pair(x1, x2));
    }
  }
  for (long long int i = 0; i < child; i++) {
    answith =
        (answith + ((f * modInverse(see[i].second, 998244353)) % 998244353) *
                       (see[i].first) % 998244353) %
        998244353;
  }
  long long int x = (answithout21 - answithout22 + 998244353) % 998244353;
  vector<long long int> fin;
  fin.push_back(answith);
  fin.push_back(answithout1);
  fin.push_back((x));
  return fin;
}
void run() {
  long long int n;
  cin >> n;
  vector<long long int> adj[n + 1];
  for (long long int i = 1; i < n; i++) {
    long long int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  vector<long long int> f = dfs(1, adj);
  cout << ((f[0] + f[1]) % 998244353) << endl;
}
int main() { run(); }
