#include <bits/stdc++.h>
using namespace std;
vector<vector<long long>> dp, edges;
vector<int> visited;
void dfs(int idx) {
  visited[idx] = 1;
  for (int i = 0; i < edges[idx].size(); i++) {
    const int& to = edges[idx][i];
    if (!visited[to]) {
      dfs(to);
      dp[0][idx] *= (2 * dp[0][to] % 998244353LL + 2 * dp[1][to] % 998244353LL -
                     dp[2][to] % 998244353LL + 998244353LL) %
                    998244353LL;
      dp[0][idx] %= 998244353LL;
      dp[1][idx] *=
          (2 * dp[0][to] + dp[1][to] - dp[2][to] + 998244353LL) % 998244353LL;
      dp[1][idx] %= 998244353LL;
      dp[2][idx] *=
          (dp[0][to] + dp[1][to] - dp[2][to] + 998244353LL) % 998244353LL;
      dp[2][idx] %= 998244353LL;
    }
  }
}
int main() {
  int n;
  int a, b;
  scanf("%d", &n);
  edges.resize(n + 1);
  for (int i = 1; i < n; i++) {
    scanf("%d", &a);
    scanf("%d", &b);
    edges[a].emplace_back(b);
    edges[b].emplace_back(a);
  }
  visited.assign(n + 1, 0);
  dp.assign(3, vector<long long>(n + 1, 1));
  dfs(1);
  long long result = dp[0][1] + dp[1][1] - dp[2][1] - 1 + 998244353LL;
  result %= 998244353LL;
  printf("%lld", result);
  return 0;
}
