#include <bits/stdc++.h>
using namespace std;
vector<int> g[300008];
int n, u, v, m = 998244353, f[300008], h[300008];
int dfs(int p, int q, int r = 0, int s = 0, int d = 1, long long t = 0) {
  for (f[p] = h[p] = 1, r = g[p].size(); r--;
       (s = g[p][r]) == q
           ? 0
           : (h[p] = h[p] * (t = dfs(s, p)) % m,
             f[p] = f[p] * ((t << 1) % m + h[s]) % m, d = d * (t + f[s]) % m))
    ;
  return (d = (d - h[p] + f[p]) % m) < 0 ? d + m : d;
}
int main() {
  for (scanf("%d", &n); --n;
       scanf("%d%d", &u, &v), g[u].push_back(v), g[v].push_back(u))
    ;
  printf("%d\n", (n = dfs(1, 0)) ? n - 1 : m - 1), exit(0);
}
