#include <bits/stdc++.h>
void rd(int &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch <= '9' && ch >= '0') x = x * 10 + ch - '0', ch = getchar();
  x *= f;
}
void lrd(long long &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch <= '9' && ch >= '0') x = x * 10 + ch - '0', ch = getchar();
  x *= f;
}
const int INF = 1e9;
const long long LINF = 1e18;
const int mod = 998244353;
const int N = 3e5 + 10;
using namespace std;
int n;
int fi[N], to[N << 1], nxt[N << 1], tot;
void link(int x, int y) {
  nxt[++tot] = fi[x];
  fi[x] = tot;
  to[tot] = y;
}
int f[N][3];
void dfs(int x, int fa) {
  f[x][0] = 1;
  f[x][1] = 1;
  f[x][2] = 1;
  for (int i = fi[x]; i; i = nxt[i]) {
    if (to[i] == fa) continue;
    dfs(to[i], x);
    int tmp;
    tmp = (1ll * 2 * f[to[i]][0] + 2 * f[to[i]][1] - f[to[i]][2] + mod) % mod;
    f[x][0] = 1ll * f[x][0] * tmp % mod;
    tmp = (1ll * 2 * f[to[i]][0] + f[to[i]][1] - f[to[i]][2] + mod) % mod;
    f[x][1] = 1ll * f[x][1] * tmp % mod;
    tmp = (1ll * f[to[i]][0] + f[to[i]][1] - f[to[i]][2] + mod) % mod;
    f[x][2] = 1ll * f[x][2] * tmp % mod;
  }
}
int main() {
  rd(n);
  for (int i = 1; i < n; i++) {
    int x, y;
    rd(x);
    rd(y);
    link(x, y);
    link(y, x);
  }
  dfs(1, 0);
  printf("%d\n", (1ll * f[1][0] + f[1][1] - f[1][2] - 1 + mod) % mod);
  return 0;
}
