#include <bits/stdc++.h>
inline long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  for (; c > '9' || c < '0'; c = getchar()) {
    if (c == '-') f = -1;
  }
  for (; c >= '0' && c <= '9'; c = getchar()) {
    x = x * 10 + c - '0';
  }
  return x * f;
}
const int mod = 998244353;
long long dp[300005][3];
std::vector<int> vec[300005];
void dfs(int now, int fa) {
  dp[now][0] = dp[now][1] = dp[now][2] = 1;
  for (auto i : vec[now]) {
    if (i == fa) continue;
    dfs(i, now);
    long long disconnect = (dp[i][0] + dp[i][1] - dp[i][2] + mod) % mod;
    dp[now][0] = dp[now][0] * (dp[i][0] + dp[i][1] + disconnect) % mod;
    dp[now][1] = dp[now][1] * (dp[i][0] + disconnect) % mod;
    dp[now][2] = dp[now][2] * disconnect % mod;
  }
}
inline void work() {
  int n = read();
  for (int i = 1; i < n; i++) {
    int u = read(), v = read();
    vec[u].push_back(v);
    vec[v].push_back(u);
  }
  dfs(1, 0);
  printf("%lld\n", (dp[1][0] + dp[1][1] - dp[1][2] - 1 + mod) % mod);
}
int main() {
  work();
  return 0;
}
