#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353LL;
const int mx = 300050;
vector<int> adjlist[mx];
long long dp[mx][3];
void dfs(int u, int from) {
  int i, v, l = adjlist[u].size();
  dp[u][0] = dp[u][1] = dp[u][2] = 1;
  long long here;
  for (i = 0; i < l; i++) {
    v = adjlist[u][i];
    if (v == from) continue;
    dfs(v, u);
    here = dp[v][0] + dp[v][1] - dp[v][2] + mod;
    here = here % mod;
    dp[u][2] = (dp[u][2] * here) % mod;
    here += dp[v][0];
    here = here % mod;
    dp[u][1] = (dp[u][1] * here) % mod;
    here += dp[v][1];
    here = here % mod;
    dp[u][0] = (dp[u][0] * here) % mod;
  }
}
int main() {
  int n, i, u, v;
  scanf("%d", &n);
  for (i = 1; i < n; i++) {
    scanf("%d %d", &u, &v);
    adjlist[u].push_back(v);
    adjlist[v].push_back(u);
  }
  dfs(1, -1);
  long long ans = dp[1][0] + dp[1][1] - dp[1][2] + mod;
  ans = ans % mod;
  ans--;
  if (ans < 0) ans += mod;
  printf("%lld\n", ans);
}
