#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 5, mod = 998244353;
vector<int> E[maxn];
long long dp0[maxn], dp1[maxn][2], dp2[maxn][2];
void dfs(int x, int fa) {
  dp0[x] = dp1[x][0] = dp1[x][1] = 1;
  if (E[x].size() == 1 && x != 1) return;
  dp2[x][0] = dp2[x][1] = 1;
  long long temp = 1;
  for (auto i : E[x]) {
    if (i == fa) continue;
    dfs(i, x);
    dp0[x] = dp0[x] * (dp2[i][0] + dp2[i][1] + dp0[i]) % mod;
    dp1[x][0] = dp1[x][1] = dp1[x][0] * (dp0[i] + dp2[i][0] + dp2[i][1]) % mod;
    dp2[x][0] =
        dp2[x][0] *
        (dp1[i][0] + dp1[i][1] + 2 * dp2[i][0] + 2 * dp2[i][1] + dp0[i]) % mod;
    dp2[x][1] =
        dp2[x][1] * (dp1[i][0] + 2 * dp2[i][0] + dp2[i][1] + dp0[i]) % mod;
  }
  dp2[x][0] = (dp2[x][0] - dp1[x][0] + mod) % mod;
  dp2[x][1] = (dp2[x][1] - dp1[x][1] + mod) % mod;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    int x, y;
    cin >> x >> y;
    E[x].push_back(y);
    E[y].push_back(x);
  }
  dfs(1, 1);
  cout << (dp0[1] + dp2[1][0] + dp2[1][1] - 1 + mod) % mod << endl;
}
