#include <bits/stdc++.h>
using namespace std;
const static int inf = 0x3f3f3f3f;
const static long long INF = 0x3f3f3f3f3f3f3f3f;
const static int maxn = 3e5 + 10;
const long long mod = 998244353;
vector<int> g[maxn];
long long f[maxn][3][3];
int n;
void dfs(int u, int fa) {
  f[u][0][0] = f[u][0][1] = f[u][1][0] = f[u][1][1] = 1;
  long long mul = 1;
  for (int i = 0; i < g[u].size(); i++) {
    int v = g[u][i];
    if (v == fa) continue;
    dfs(v, u);
    f[u][0][0] = (f[u][0][0] *
                  ((f[v][0][0] + f[v][0][1] + f[v][1][0] + f[v][1][1]) % mod)) %
                 mod;
    f[u][0][1] =
        (f[u][0][1] * ((f[v][0][0] + f[v][0][1] + f[v][1][0]) % mod)) % mod;
    f[u][1][0] = (f[u][1][0] *
                  ((f[v][0][0] + f[v][0][1] + f[v][1][0] + f[v][1][1]) % mod)) %
                 mod;
    f[u][1][1] =
        (f[u][1][1] * ((f[v][0][0] + f[v][0][1] + f[v][1][0]) % mod)) % mod;
    mul = (mul * (f[v][0][1] + f[v][0][0]) % mod) % mod;
  }
  f[u][0][1] = (f[u][0][1] - mul + mod) % mod;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) g[i].clear();
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(1, 0);
  cout << (f[1][0][1] + f[1][0][0] + mod - 1) % mod << endl;
  return 0;
}
