#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
int dp[300001][3];
vector<int> adj[300001];
int n;
int solve(int node, int par, int col) {
  if (dp[node][col] != -1) return dp[node][col];
  dp[node][col] = 1;
  for (auto it : adj[node]) {
    if (it == par) continue;
    int val = 0;
    if (col == 0) {
      val = (2 * solve(it, node, 0)) % mod + (2 * solve(it, node, 1)) % mod;
      val %= mod;
      val -= solve(it, node, 2);
      val += mod;
      val %= mod;
      dp[node][col] = (1LL * dp[node][col] * val) % mod;
    } else if (col == 1) {
      val = (2 * solve(it, node, 0)) % mod + solve(it, node, 1);
      val %= mod;
      val -= solve(it, node, 2);
      val += mod;
      val %= mod;
      dp[node][col] = (1LL * dp[node][col] * val) % mod;
    } else {
      val = (solve(it, node, 0)) % mod + solve(it, node, 1) % mod;
      val %= mod;
      val -= solve(it, node, 2);
      val += mod;
      val %= mod;
      dp[node][col] = (1LL * dp[node][col] * val) % mod;
    }
  }
  return dp[node][col];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  memset(dp, -1, sizeof(dp));
  cin >> n;
  for (int i = 1; i < n; i++) {
    int a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  int ans = (solve(1, 0, 0) + solve(1, 0, 1)) % mod;
  ans -= solve(1, 0, 2);
  ans += mod;
  ans %= mod;
  ans--;
  ans += mod;
  ans %= mod;
  cout << ans;
}
