#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("fast-math")
using namespace std;
void solve();
signed main() {
  srand(time(0));
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout.setf(ios::fixed);
  cout.precision(10);
  solve();
  return 0;
}
const long long MOD = 998244353, MAXN = 1e6 + 10, INF = 1e18 + 10, BASE = 37;
long long n;
vector<long long> g[MAXN];
long long f1[MAXN][2], f2[MAXN];
void dfs(long long v, long long p = 0) {
  f1[v][0] = 1, f1[v][1] = 1, f2[v] = 1;
  for (auto u : g[v]) {
    if (u != p) {
      dfs(u, v);
      f1[v][0] = (f1[v][0] * (2 * f1[u][0] + 2 * f1[u][1] - f2[u] + MOD) % MOD);
      f1[v][1] = (f1[v][1] * (2 * f1[u][0] + f1[u][1] - f2[u] + MOD) % MOD);
      f2[v] = (f2[v] * (f1[u][0] + f1[u][1] - f2[u] + MOD)) % MOD;
    }
  }
}
void solve() {
  cin >> n;
  for (long long i = 0; i < n - 1; ++i) {
    long long u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(1);
  cout << (f1[1][0] + f1[1][1] - f2[1] - 1 + 2 * MOD) % MOD << '\n';
}
