#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
vector<vector<int>> g;
vector<array<long long, 5>> v;
void dfs(int i, int p) {
  v[i] = {1, 1, 1, 1, 1};
  bool lf = true;
  for (int j : g[i]) {
    if (j == p) continue;
    lf = false;
    dfs(j, i);
    (v[i][0] *= v[j][0] + v[j][1] + v[j][2]) %= mod;
    (v[i][3] *= v[j][0] + v[j][1] + v[j][2] + v[j][4]) %= mod;
    (v[i][4] *= v[j][0] + v[j][1] + v[j][2] + v[j][3] + v[j][4]) %= mod;
  }
  v[i][1] = (v[i][3] - v[i][0]) % mod;
  v[i][2] = (v[i][4] - v[i][0]) % mod;
  if (lf) v[i] = {1, 0, 0, 1, 1};
}
int main() {
  int n;
  cin >> n;
  g.resize(n), v.resize(n);
  for (int i = 0; i < n - 1; ++i) {
    int x, y;
    cin >> x >> y;
    --x, --y;
    g[x].push_back(y), g[y].push_back(x);
  }
  dfs(0, 0);
  cout << ((v[0][0] + v[0][1] + v[0][2] - 1) % mod + mod) % mod;
}
