#include <bits/stdc++.h>
const int Mod = 998244353;
int n, dp[300005][4], h[300005], cnt;
struct edge {
  int to, nxt;
} e[300005 << 1];
void dfs(int x, int f) {
  int un = 1;
  dp[x][0] = dp[x][1] = dp[x][2] = dp[x][3] = 1;
  for (int i = h[x], y; i; i = e[i].nxt) {
    if ((y = e[i].to) != f) {
      dfs(y, x);
      un = 1ll * un * (dp[y][0] + dp[y][1]) % Mod;
      dp[x][0] = 1ll * dp[x][0] *
                 ((1ll * dp[y][0] + dp[y][1] + dp[y][2] + dp[y][3]) % Mod) %
                 Mod;
      dp[x][1] =
          1ll * dp[x][1] * ((1ll * dp[y][0] + dp[y][1] + dp[y][2]) % Mod) % Mod;
      dp[x][2] = 1ll * dp[x][2] *
                 ((1ll * dp[y][0] + dp[y][1] + dp[y][2] + dp[y][3]) % Mod) %
                 Mod;
      dp[x][3] =
          1ll * dp[x][3] * ((1ll * dp[y][0] + dp[y][1] + dp[y][2]) % Mod) % Mod;
    }
  }
  dp[x][1] = (dp[x][1] - un + Mod) % Mod;
}
void ins(int x, int y) {
  e[++cnt].nxt = h[x];
  h[x] = cnt;
  e[cnt].to = y;
}
int main() {
  scanf("%d", &n);
  for (int i = 1, x, y; i < n; i++) scanf("%d%d", &x, &y), ins(x, y), ins(y, x);
  dfs(1, 0);
  int ans = (dp[1][0] + dp[1][1]) % Mod;
  printf("%d\n", (ans - 1 + Mod) % Mod);
}
