#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
const long long mod = 998244353;
long long dp[N][3];
struct node {
  int to, next;
} e[N * 2];
int cnt, head[N];
void add(int x, int y) {
  e[cnt].to = y;
  e[cnt].next = head[x];
  head[x] = cnt++;
}
long long ans;
void dfs(int x, int fa) {
  dp[x][0] = dp[x][1] = dp[x][2] = 1;
  long long sum = 0;
  for (int i = head[x]; ~i; i = e[i].next) {
    int ne = e[i].to;
    if (ne == fa) continue;
    dfs(ne, x);
    sum = (dp[ne][0] + dp[ne][1] - dp[ne][2] + mod) % mod;
    dp[x][0] = dp[x][0] * (dp[ne][0] + dp[ne][1] + sum) % mod;
    dp[x][1] = dp[x][1] * (dp[ne][0] + sum) % mod;
    dp[x][2] = dp[x][2] * sum % mod;
  }
}
int main() {
  memset(head, -1, sizeof(head));
  int n, x, y;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) scanf("%d%d", &x, &y), add(x, y), add(y, x);
  dfs(1, 0);
  printf("%lld\n", (dp[1][0] + dp[1][1] - dp[1][2] - 1 + mod) % mod);
  return 0;
}
