#include <bits/stdc++.h>
using namespace std;
long long fastpow(long long a, long long b, long long m = 998244353LL) {
  long long res = 1;
  a %= m;
  while (b > 0) {
    if (b & 1) res = (res * a) % m;
    a = (a * a) % m;
    b >>= 1;
  }
  return res;
}
long long n, u, v;
const long long maxN = 3e5 + 5;
vector<long long> adj[maxN];
long long dp1[maxN][2], dp2[maxN];
void dfs(long long node = 1, long long parent = 1) {
  dp1[node][0] = dp1[node][1] = dp2[node] = 1;
  for (auto x : adj[node]) {
    if (x != parent) {
      dfs(x, node);
      dp1[node][0] = (((2 * dp1[x][0] + 2 * dp1[x][1] - dp2[x] + 998244353LL) %
                       998244353LL) *
                      (dp1[node][0] % 998244353LL)) %
                     998244353LL;
      dp1[node][1] =
          (((2 * dp1[x][0] + dp1[x][1] - dp2[x] + 998244353LL) % 998244353LL) *
           (dp1[node][1] % 998244353LL)) %
          998244353LL;
      dp2[node] =
          (((dp1[x][0] + dp1[x][1] - dp2[x] + 998244353LL) % 998244353LL) *
           (dp2[node] % 998244353LL)) %
          998244353LL;
    }
  }
}
int32_t main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  ;
  cin >> n;
  for (long long i = 1; i < n; i++) {
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs();
  cout << (dp1[1][0] + dp1[1][1] - dp2[1] - 1 + 2 * 998244353LL) % 998244353LL
       << endl;
  return 0;
}
