#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  while ((c < '0' || c > '9') && (c != '-')) c = getchar();
  if (c == '-') f = -1, c = getchar();
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return x * f;
}
const int N = 3e5 + 10, mod = 998244353;
int n;
vector<int> e[N];
long long dp[N][3][2];
inline void dfs(int u, int fa) {
  dp[u][0][0] = 1;
  if (u != 1) dp[u][2][0] = dp[u][2][1] = 1;
  for (auto v : e[u])
    if (v != fa) {
      dfs(v, u);
      dp[u][2][0] = dp[u][2][0] *
                    (dp[v][2][0] + dp[v][2][1] + dp[v][1][0] + dp[v][1][1] +
                     dp[v][0][0]) %
                    mod;
      dp[u][2][1] = dp[u][2][1] *
                    (dp[v][2][0] + dp[v][1][0] + dp[v][1][1] + dp[v][0][0]) %
                    mod;
      dp[u][1][0] = dp[u][1][0] *
                    (dp[v][2][0] + dp[v][2][1] + dp[v][1][0] + dp[v][1][1] +
                     dp[v][0][0]) %
                    mod;
      dp[u][1][0] =
          (dp[u][1][0] + dp[u][0][0] * (dp[v][2][0] + dp[v][2][1])) % mod;
      dp[u][1][1] = dp[u][1][1] *
                    (dp[v][2][0] + dp[v][1][0] + dp[v][1][1] + dp[v][0][0]) %
                    mod;
      dp[u][1][1] = (dp[u][1][1] + dp[u][0][0] * dp[v][2][0]) % mod;
      dp[u][0][0] =
          1ll * dp[u][0][0] * (dp[v][1][0] + dp[v][1][1] + dp[v][0][0]) % mod;
    }
}
int main() {
  n = read();
  for (register int i = (1); i < (n); i++) {
    int x = read(), y = read();
    e[x].push_back(y), e[y].push_back(x);
  }
  dfs(1, 0);
  printf("%lld\n", (dp[1][0][0] + dp[1][1][0] + dp[1][1][1] + mod - 1) % mod);
}
