#include <bits/stdc++.h>
using namespace std;
const int N = 3e5;
const long long mod = 998244353;
namespace IO {
inline long long read() {
  long long s = 0, ww = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') ww = -1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9') {
    s = 10 * s + ch - '0';
    ch = getchar();
  }
  return s * ww;
}
inline void write(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) write(x / 10);
  putchar('0' + x % 10);
}
}  // namespace IO
using namespace IO;
namespace ModCalc {
inline void Inc(long long &x, long long y) {
  x += y;
  if (x >= mod) x -= mod;
}
inline void Dec(long long &x, long long y) {
  x -= y;
  if (x < 0) x += mod;
}
inline long long Add(long long x, long long y) {
  Inc(x, y);
  return x;
}
inline long long Sub(long long x, long long y) {
  Dec(x, y);
  return x;
}
}  // namespace ModCalc
using namespace ModCalc;
long long f[N + 5][2], g[N + 5];
vector<int> link[N + 5];
void dfs(int u, int fa) {
  if (link[u].size() == 1 && u != 1) {
    f[u][0] = f[u][1] = g[u] = 1;
    return;
  }
  f[u][0] = f[u][1] = g[u] = 1;
  for (auto v : link[u]) {
    if (v == fa) continue;
    dfs(v, u);
    f[u][0] =
        f[u][0] * Sub(Add(2 * f[v][0] % mod, 2 * f[v][1] % mod), g[v]) % mod;
    f[u][1] = f[u][1] * Sub(Add(2 * f[v][0] % mod, f[v][1]), g[v]) % mod;
    g[u] = g[u] * Sub(Add(f[v][0], f[v][1]), g[v]) % mod;
  }
}
int main() {
  int n = read();
  for (register int i = 1; i < n; i++) {
    int u = read(), v = read();
    link[u].push_back(v);
    link[v].push_back(u);
  }
  dfs(1, 0);
  write(Sub(Add(f[1][0], f[1][1]), Add(g[1], 1))), putchar('\n');
  return 0;
}
