#include <bits/stdc++.h>
using namespace std;
inline void read(int &x) {
  char ch = getchar();
  x = 0;
  while (!isdigit(ch)) ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - 48, ch = getchar();
}
const int N = 3e5 + 10, mod = 998244353;
int n, res, f[N][3];
int cnt, h[N], nxt[N << 1], to[N << 1];
inline void add(int u, int v) { to[++cnt] = v, nxt[cnt] = h[u], h[u] = cnt; }
void dfs(int u, int la) {
  f[u][0] = f[u][1] = f[u][2] = 1;
  for (int i = h[u], v; i; i = nxt[i]) {
    if ((v = to[i]) == la) continue;
    dfs(v, u);
    f[u][2] = 1ll * f[u][2] * (1ll * f[v][0] + f[v][1] - f[v][2]) % mod;
    f[u][1] = 1ll * f[u][1] * (2ll * f[v][0] + f[v][1] - f[v][2]) % mod;
    f[u][0] = 1ll * f[u][0] * (2ll * f[v][0] + 2 * f[v][1] - f[v][2]) % mod;
  }
}
signed main() {
  read(n);
  for (int i = 1, u, v; i < n; ++i) read(u), read(v), add(u, v), add(v, u);
  dfs(1, 1);
  return printf("%d\n", ((f[1][0] + f[1][1] - f[1][2] - 1) % mod + mod) % mod),
         0;
}
