#include <bits/stdc++.h>
using namespace std;
long long poww(long long a, long long b, long long md) {
  return (!b ? 1
             : (b & 1 ? a * poww(a * a % md, b / 2, md) % md
                      : poww(a * a % md, b / 2, md) % md));
}
const long long MAXN = 1e6 + 10;
const long long INF = 8e18;
const long long MOD = 998244353;
long long dp[MAXN][3], n;
vector<int> adj[MAXN];
void dfs(int v, int p) {
  dp[v][0] = dp[v][1] = dp[v][2] = 1;
  for (int u : adj[v]) {
    if (u == p) continue;
    dfs(u, v);
    dp[v][0] *= (dp[u][1] + dp[u][2] - dp[u][0] + MOD) % MOD, dp[v][0] %= MOD;
    dp[v][1] *= (2 * dp[u][2] + dp[u][1] - dp[u][0] + MOD) % MOD,
        dp[v][1] %= MOD;
    dp[v][2] *= (2 * dp[u][2] + 2 * dp[u][1] - dp[u][0] + MOD) % MOD,
        dp[v][2] %= MOD;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(1, 0);
  cout << (dp[1][1] + dp[1][2] - dp[1][0] - 1 + 2 * MOD) % MOD << '\n';
  return 0;
}
