#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 7, N = 3e5 + 7, M = 998244353;
vector<long long> G[N];
long long dp[N][3];
void dfs(long long u, long long p = -1) {
  dp[u][0] = dp[u][1] = dp[u][2] = 1;
  for (long long v : G[u])
    if (v != p) {
      dfs(v, u);
      dp[u][0] = dp[u][0] *
                 ((dp[v][0] + dp[v][1] + dp[v][2] + dp[v][0] + dp[v][1]) % M) %
                 M;
      dp[u][1] = dp[u][1] * ((dp[v][0] + dp[v][1] + dp[v][0]) % M) % M;
      dp[u][2] = dp[u][2] * ((dp[v][0] + dp[v][1]) % M) % M;
    }
  dp[u][1] = (dp[u][1] - dp[u][2] + M) % M;
}
signed main() {
  std::ios::sync_with_stdio(0);
  std::cin.tie(0);
  ;
  long long n;
  cin >> n;
  for (long long i = 0; i < n - 1; i++) {
    long long u, v;
    cin >> u >> v;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  dfs(1);
  cout << (dp[1][0] + dp[1][1] + M - 1) % M << endl;
}
