#include <bits/stdc++.h>
using namespace std;
const long long maxn = 300007;
const long long mod = 998244353;
vector<vector<long long>> adj(maxn);
long long dp[maxn][2];
long long dp2[maxn];
long long n;
bool visited[maxn];
void init() { memset(visited, 0, sizeof(visited)); }
void dfs(long long v, long long dp[][2], long long dp2[maxn]) {
  visited[v] = 1;
  long long smallans1 = 1, smallans2 = 1, smallans3 = 1;
  for (long long i = 0; i < adj[v].size(); i++) {
    if (visited[adj[v][i]] == 0) {
      long long u = adj[v][i];
      dfs(u, dp, dp2);
      smallans1 *=
          (2 * (dp[u][0] % mod) + 2 * (dp[u][1] % mod) - dp2[u] + mod) % mod;
      smallans1 %= mod;
      smallans2 *=
          (2 * (dp[u][0] % mod) + (dp[u][1] % mod) - dp2[u] + mod) % mod;
      smallans2 %= mod;
      smallans3 *= ((dp[u][0] % mod) + (dp[u][1] % mod) - dp2[u] + mod) % mod;
      smallans3 %= mod;
    }
  }
  dp[v][0] = smallans1 % mod;
  dp[v][1] = smallans2 % mod;
  dp2[v] = smallans3 % mod;
}
int32_t main() {
  cin >> n;
  long long x, y;
  for (long long i = 0; i < n - 1; i++) {
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  init();
  dp[1][0] = dp[1][1] = dp2[1] = 1;
  dfs(1, dp, dp2);
  long long ans = (dp[1][0] + dp[1][1] - dp2[1] - 1 + mod) % mod;
  cout << ans << endl;
}
