#include <bits/stdc++.h>
using namespace std;
const int N_MAX = 300002;
const int MOD = 998244353;
int pwr(int a, int b) {
  if (b == 0) return 1;
  if (b & 1) return 1LL * pwr(a, (b ^ 1)) * a % MOD;
  int aux = pwr(a, (b >> 1));
  return 1LL * aux * aux % MOD;
}
int n;
vector<int> edges[N_MAX];
int black[N_MAX], white[N_MAX], bdown[N_MAX];
void dfs(int node, int parent = -1) {
  white[node] = 1;
  black[node] = 1 + (parent != -1);
  bdown[node] = 1;
  for (int u : edges[node])
    if (u != parent) {
      dfs(u, node);
      black[node] = black[node] * (bdown[u] + white[u] * 2LL) % MOD;
      bdown[node] = bdown[node] * (bdown[u] + white[u] * 2LL) % MOD;
      white[node] = white[node] * (black[u] + white[u] * 2LL) % MOD;
    }
  int bad = 1;
  for (int u : edges[node])
    if (u != parent) bad = 1LL * bad * (bdown[u] + white[u]) % MOD;
  black[node] -= bad;
  bdown[node] -= bad;
  if (black[node] < 0) black[node] += MOD;
  if (bdown[node] < 0) bdown[node] += MOD;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    edges[u].push_back(v);
    edges[v].push_back(u);
  }
  dfs(1);
  cout << (black[1] + white[1] - 1LL + MOD) % MOD << "\n";
  return 0;
}
