#include <bits/stdc++.h>
using namespace std;
using namespace std;
void io() {}
vector<long long> adj[3000001];
long long dp[3000001][2];
long long f[3000001];
void dfs(long long u, long long par) {
  long long &res0 = dp[u][0] = 1;
  long long &res1 = dp[u][1] = 1;
  long long &res = f[u] = 1;
  for (long long v : adj[u]) {
    if (v != par) {
      dfs(v, u);
      res0 *= (dp[v][0] + dp[v][1] + dp[v][0] + (dp[v][1] - f[v]));
      res0 %= (long long)(998244353);
      res1 *= (dp[v][0] + dp[v][0] + (dp[v][1] - f[v]));
      res1 %= (long long)(998244353);
      res *= (dp[v][0] + (dp[v][1] - f[v]));
      res %= (long long)(998244353);
    }
  }
}
int32_t main() {
  io();
  ios ::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  for (long long i = 0; i < n - 1; i++) {
    long long a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  dfs(1, -1);
  cout << (dp[1][0] + dp[1][1] - f[1] - 1 + 2 * (long long)(998244353)) %
              (long long)(998244353);
}
