#include <bits/stdc++.h>
using namespace std;
int first[300005], ecnt = 0;
long long int dp[300005][3];
struct Edge {
  int to;
  int nxt;
} edge[600005];
void add(int u, int v) {
  edge[ecnt] = {v, first[u]};
  first[u] = ecnt++;
}
void dfs(int u, int fa) {
  int i = first[u];
  dp[u][0] = 1;
  dp[u][1] = 1;
  dp[u][2] = 1;
  while (i >= 0) {
    int v = edge[i].to;
    if (v != fa) {
      dfs(v, u);
      dp[u][0] *=
          (dp[v][0] + 2 * dp[v][1] - dp[v][2] + 2 * 998244353) % 998244353;
      dp[u][0] %= 998244353;
      dp[u][1] *=
          (2 * dp[v][0] + 2 * dp[v][1] - dp[v][2] + 2 * 998244353) % 998244353;
      dp[u][1] %= 998244353;
      dp[u][2] *= (dp[v][0] + dp[v][1] - dp[v][2] + 2 * 998244353) % 998244353;
      dp[u][2] %= 998244353;
    }
    i = edge[i].nxt;
  }
}
int main() {
  int n, u, v;
  cin >> n;
  for (int i = 1; i <= n; i++) first[i] = -1;
  for (int i = 0; i < n - 1; i++) {
    cin >> u >> v;
    add(u, v);
    add(v, u);
  }
  dfs(1, 0);
  cout << (dp[1][0] + dp[1][1] - dp[1][2] - 1 + 998244353) % 998244353 << endl;
  return 0;
}
