#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 6;
const long long MOD = 998244353;
vector<int> g[N];
long long dp[N][3];
void dfs(int v, int par = -1) {
  for (auto to : g[v]) {
    if (to == par) continue;
    dfs(to, v);
  }
  {
    long long ans1 = 1;
    for (auto to : g[v]) {
      if (to == par) continue;
      ans1 *= (dp[to][1] + dp[to][2]) % MOD;
      ans1 %= MOD;
    }
    long long ans2 = 1;
    for (auto to : g[v]) {
      if (to == par) continue;
      ans2 *= (dp[to][0] + dp[to][2]) % MOD;
      ans2 %= MOD;
    }
    dp[v][0] = (ans1 + ans2) % MOD;
  }
  {
    long long ans2 = 1;
    for (auto to : g[v]) {
      if (to == par) continue;
      ans2 *= (dp[to][0] + dp[to][2]) % MOD;
      ans2 %= MOD;
    }
    dp[v][1] = (ans2) % MOD;
  }
  {
    long long ans1 = 1;
    long long ans3 = 1;
    for (auto to : g[v]) {
      if (to == par) continue;
      ans1 *= (dp[to][1] + dp[to][2]) % MOD;
      ans3 *= (dp[to][2]);
      ans3 %= MOD;
      ans1 %= MOD;
    }
    long long ans2 = 1;
    for (auto to : g[v]) {
      if (to == par) continue;
      ans2 *= (dp[to][0] + dp[to][2]) % MOD;
      ans2 %= MOD;
    }
    dp[v][2] = (ans1 + ans2) % MOD;
    dp[v][2] = (dp[v][2] - ans3 + MOD) % MOD;
  }
}
void solve() {
  int n;
  cin >> n;
  for (int i = 0; i < (n - 1); ++i) {
    int a, b;
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dfs(1);
  cout << (dp[1][2] - 1ll + MOD) % MOD << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  ;
  int ttt = 1;
  while (ttt--) {
    solve();
  }
  return 0;
}
