#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << "\n";
  err(++it, args...);
}
const double PI = acos(-1);
const double eps = (1e-9);
const long long int INF = 1e16;
const long long int Max = (1e15);
const int M = 998244353;
const int N = (3e5) + 3;
long long int pro(long long int a, long long int b) {
  if (b < 0) b += M;
  if (b > 2 * M) b -= (2 * M);
  return (a * b) % M;
}
long long int dp[N][3];
vector<vector<int> > ad(N);
void dfs(int s, int p) {
  for (auto a : ad[s]) {
    if (a != p) {
      dfs(a, s);
      dp[s][0] = pro(dp[s][0], 2 * dp[a][0] + 2 * dp[a][1] - dp[a][2]);
      dp[s][1] = pro(dp[s][1], 2 * dp[a][0] + dp[a][1] - dp[a][2]);
      dp[s][2] = pro(dp[s][2], dp[a][0] + dp[a][1] - dp[a][2]);
    }
  }
  return;
}
void solve() {
  int n, i, a, b, j;
  scanf("%d", &n);
  for (i = 0; i < n - 1; ++i) {
    scanf("%d%d", &a, &b);
    ad[a].emplace_back(b);
    ad[b].emplace_back(a);
  }
  for (i = 0; i < n + 1; ++i) {
    for (j = 0; j < 3; ++j) dp[i][j] = 1;
  };
  dfs(1, 0);
  long long int ans = dp[1][0] + dp[1][1] - dp[1][2] + M - 1;
  cout << ans % M << "\n";
}
int main() {
  int t = 1;
  while (t--) solve();
}
