#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const long long maxn = 300007;
const long long mod = 998244353;
long long n, dp[maxn][2], f[maxn];
vector<long long> vec[maxn];
long long mult(long long u, long long v) {
  u = (u % mod + mod) % mod, v = (v % mod + mod) % mod;
  return 1ll * u * v % mod;
}
void dfs(long long u, long long p) {
  dp[u][0] = dp[u][1] = f[u] = 1;
  for (auto c : vec[u]) {
    if (c == p) continue;
    dfs(c, u);
    dp[u][0] = mult(dp[u][0], 2 * dp[c][0] + 2 * dp[c][1] - f[c]);
    dp[u][1] = mult(dp[u][1], dp[c][1] + 2 * dp[c][0] - f[c]);
    f[u] = mult(f[u], dp[c][0] + dp[c][1] - f[c]);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 1; i < n; ++i) {
    int u, v;
    cin >> u >> v;
    vec[u].push_back(v), vec[v].push_back(u);
  }
  dfs(1, 0);
  cout << (dp[1][0] + dp[1][1] - f[1] - 1 + 2 * mod) % mod << endl;
  return 0;
}
