#include <bits/stdc++.h>
using namespace std;
constexpr int MAXN = 300000, MOD = 998244353;
vector<int> adj[MAXN + 2];
int reduce(int x) { return x >= MOD ? x - MOD : x; }
tuple<int, int, int> dfs(int u, int w) {
  int a = 1, b = 1, c = 1;
  for (int v : adj[u]) {
    if (v == w) continue;
    auto [va, vb, vc] = dfs(v, u);
    a = (long long)a * ((long long)2 * ((long long)va + vb + vc) + vc) % MOD;
    b = (long long)b * ((long long)2 * (va + vc) + vb) % MOD;
    c = (long long)c * ((long long)va + vb + vc) % MOD;
  }
  a = reduce(a + MOD - c);
  b = reduce(b + MOD - c);
  return make_tuple(a, b, c);
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  auto [a, b, c] = dfs(1, 1);
  int ans = ((long long)a + b + c + MOD - 1) % MOD;
  cout << ans << '\n';
}
