#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
const int maxn = 300005;
vector<int> v[maxn];
long long dp[maxn][3];
void dfs(int x, int p) {
  dp[x][0] = dp[x][1] = dp[x][2] = 1;
  for (auto y : v[x]) {
    if (p == y) continue;
    dfs(y, x);
    dp[x][0] = (2 * dp[y][0] + 2 * dp[y][1] - dp[y][2]) * dp[x][0] % MOD;
    dp[x][1] = (2 * dp[y][0] + dp[y][1] - dp[y][2]) * dp[x][1] % MOD;
    dp[x][2] = (dp[y][0] + dp[y][1] - dp[y][2]) * dp[x][2] % MOD;
  }
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    int x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  dfs(1, 0);
  cout << ((dp[1][0] + dp[1][1] - dp[1][2] - 1) % MOD + MOD) % MOD << endl;
  return 0;
}
