#include <bits/stdc++.h>
using namespace std;
int n, vis[300005];
vector<int> q[300005];
long long dp[300005][2], f[300005];
void dfs(int u) {
  dp[u][0] = 1LL;
  dp[u][1] = 1LL;
  f[u] = 1LL;
  long long res = 1LL;
  int check = 0;
  vis[u] = 1;
  for (int i = 0; i < q[u].size(); i++) {
    int v = q[u][i];
    if (!vis[v]) {
      check = 1;
      dfs(v);
      dp[u][0] = (dp[u][0] *
                  ((f[v] * 2 + 2 + dp[v][0] + dp[v][1]) + dp[v][0] + dp[v][1] +
                   f[v] + 1) %
                  998244353) %
                 998244353;
      dp[u][1] =
          (dp[u][1] * ((f[v] + 1 + dp[v][0]) + dp[v][0] + dp[v][1] + f[v] + 1) %
           998244353) %
          998244353;
      f[u] = (f[u] * (dp[v][0] + dp[v][1] + f[v] + 1) % 998244353) % 998244353;
      res = (res * (dp[v][0] + dp[v][1] + f[v] + 1) % 998244353) % 998244353;
    }
  }
  if (check == 0) {
    dp[u][0] = 0LL;
    dp[u][1] = 0LL;
    f[u] = 0LL;
  } else {
    dp[u][0] = (dp[u][0] + 998244353 - res) % 998244353;
    dp[u][1] = (dp[u][1] + 998244353 - res) % 998244353;
    f[u] = (f[u] + 998244353 - 1) % 998244353;
  }
}
void solve() {
  cin >> n;
  for (int i = 1; i < n; i++) {
    int x, y;
    cin >> x >> y;
    q[x].push_back(y);
    q[y].push_back(x);
  }
  dfs(1);
  cout << (dp[1][0] + dp[1][1] + f[1]) % 998244353 << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
}
