#include <bits/stdc++.h>
using namespace std;
long long dp[300005][2][2], h[300005], n, cnt, ans;
struct l1 {
  long long to, next;
} p[600005];
long long add(long long x) { return x >= 998244353 ? x - 998244353 : x; }
long long jian(long long x) { return x < 0 ? x + 998244353 : x; }
void add(long long x, long long y) {
  cnt++;
  p[cnt].to = y;
  p[cnt].next = h[x];
  h[x] = cnt;
}
void dfs(long long x, long long fa) {
  dp[x][0][0] = dp[x][0][1] = dp[x][1][0] = dp[x][1][1] = 1;
  long long now = 1;
  for (long long i = h[x]; i; i = p[i].next) {
    long long y = p[i].to;
    if (y == fa) continue;
    dfs(y, x);
    now = now * (dp[y][0][0] + dp[y][0][1]) % 998244353;
    dp[x][0][0] = dp[x][0][0] *
                  (dp[y][0][0] + dp[y][0][1] + dp[y][1][0] + dp[y][1][1]) %
                  998244353;
    dp[x][0][1] =
        dp[x][0][1] * (dp[y][0][0] + dp[y][0][1] + dp[y][1][0]) % 998244353;
    dp[x][1][0] = dp[x][1][0] *
                  (dp[y][0][0] + dp[y][0][1] + dp[y][1][0] + dp[y][1][1]) %
                  998244353;
    dp[x][1][1] =
        dp[x][1][1] * (dp[y][0][0] + dp[y][0][1] + dp[y][1][0]) % 998244353;
  }
  dp[x][0][1] = jian(dp[x][0][1] - now);
}
int main() {
  scanf("%lld", &n);
  for (long long i = 1; i < n; i++) {
    long long x, y;
    scanf("%lld%lld", &x, &y);
    add(x, y);
    add(y, x);
  }
  dfs(1, 0);
  ans = add(dp[1][0][0] + dp[1][0][1]);
  printf("%lld", jian(ans - 1));
}
