#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
const double PI = acos(-1.0);
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const long long N = 3e5 + 10;
long long n;
vector<long long> adj[N];
long long dp0[N], dp1[N], dp[N];
void dfs(long long node, long long par) {
  dp0[node] = dp1[node] = dp[node] = 1;
  for (long long i : adj[node]) {
    if (i == par) continue;
    dfs(i, node);
    dp0[node] *= (2 * dp0[i] + 2 * dp1[i] - dp[i] + 998244353) % 998244353;
    dp0[node] %= 998244353;
    dp1[node] *= (2 * dp0[i] + dp1[i] - dp[i] + 998244353) % 998244353;
    dp1[node] %= 998244353;
    dp[node] *= (998244353 + dp0[i] + dp1[i] - dp[i]) % 998244353;
    dp[node] %= 998244353;
  }
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (long long i = 1; i < n; i++) {
    long long u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(1, 0);
  cout << (dp0[1] + dp1[1] - dp[1] - 1 + 2 * 998244353) % 998244353;
}
