#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long inf = 0x3f3f3f3f3f3f3f3f;
const long long mod = 998244353;
const int N = 3e5 + 10;
int n;
vector<int> G[N];
long long dp[N][3], p[N];
void dfs(int u, int _fa) {
  dp[u][0] = dp[u][1] = dp[u][2] = 1ll;
  for (int v : G[u]) {
    if (v == _fa) continue;
    dfs(v, u);
    p[v] = (dp[v][0] + dp[v][1] - dp[v][2] + mod) % mod;
    dp[u][0] = dp[u][0] * (dp[v][0] + dp[v][1] + p[v]) % mod;
    dp[u][1] = dp[u][1] * (dp[v][0] + p[v]) % mod;
    dp[u][2] = dp[u][2] * p[v] % mod;
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  dfs(1, 0);
  printf("%lld\n", (dp[1][0] + dp[1][1] - dp[1][2] - 1 + mod) % mod);
  return 0;
}
