#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
const int mod = 998244353;
int n;
vector<int> adj[N];
long long dp[N][2], D[N];
void dfs(int u = 0, int p = -1) {
  dp[u][0] = dp[u][1] = D[u] = 1;
  for (int v : adj[u]) {
    if (v == p) continue;
    dfs(v, u);
    dp[u][0] = dp[u][0] * ((2 * dp[v][1] + 2 * dp[v][0] - D[v]) % mod) % mod;
    dp[u][1] = dp[u][1] * ((dp[v][0] * 2 + dp[v][1] - D[v]) % mod) % mod;
    D[u] = D[u] * (dp[v][0] + dp[v][1] - D[v]) % mod;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i < n; ++i) {
    int u, v;
    cin >> u >> v;
    --u;
    --v;
    adj[u].emplace_back(v);
    adj[v].emplace_back(u);
  }
  dfs();
  cout << ((dp[0][1] + dp[0][0] - D[0]) % mod + mod - 1) % mod;
  return 0;
}
