#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], nxt[N << 1], to[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) {
  f[x][0] = f[x][1] = f[x][2] = 1;
  int cnt = 1;
  int ghb = 1;
  for (int i = fi[x]; i; i = nxt[i]) {
    if (f[to[i]][0]) continue;
    dfs(to[i]);
    cnt = cnt * 2 % mod;
    int tmp;
    tmp = (1ll * f[to[i]][0] * 2 + f[to[i]][1] + f[to[i]][2]) % mod;
    f[x][0] = 1ll * f[x][0] * tmp % mod;
    f[x][1] = 1ll * f[x][1] * (1ll * 2 * f[to[i]][0] + f[to[i]][1]) % mod;
    ghb = 1ll * ghb * (f[to[i]][0] + f[to[i]][1]) % mod;
    f[x][2] = 1ll * f[x][2] * (1ll * f[to[i]][0] * 2 + f[to[i]][1]) % mod;
  }
  f[x][1] = (f[x][1] - ghb + mod) % 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);
  printf("%d\n", (f[1][0] + f[1][1] - 1) % mod);
  return 0;
}
