#include <bits/stdc++.h>
using namespace std;
inline void chkmax(long long &a, long long b) {
  if (a < b) a = b;
}
inline void chkmin(long long &a, long long b) {
  if (a > b) a = b;
}
inline long long read() {
  long long a = 0, fh = 1;
  char c = getchar();
  while (c > '9' || c < '0') {
    if (c == '-') fh = -1;
    c = getchar();
  }
  while ('0' <= c && c <= '9') {
    a = a * 10 + c - 48;
    c = getchar();
  }
  return a * fh;
}
vector<long long> edge[300005];
long long f[300005][2][2], tmp[2][2];
long long n, fa[300005];
void dfs(long long x) {
  f[x][0][0] = 1;
  f[x][0][1] = 1;
  for (long long i = 0; i < edge[x].size(); ++i) {
    if (fa[x] == edge[x][i]) continue;
    fa[edge[x][i]] = x;
    dfs(edge[x][i]);
    long long v = edge[x][i];
    for (long long j = 0; j < 2; ++j)
      for (long long k = 0; k < 2; ++k) tmp[j][k] = f[x][j][k];
    f[x][0][0] *= (f[v][0][0] + f[v][1][0] + f[v][1][1]) % 998244353;
    f[x][0][1] *= (f[v][0][0] + f[v][1][0] + f[v][1][1]) % 998244353;
    f[x][1][0] =
        (f[x][1][0] *
             ((f[v][0][0] * 2 + f[v][0][1] + f[v][1][1] * 2 + f[v][1][0] * 2) %
              998244353) %
             998244353 +
         tmp[0][0] * ((f[v][0][0] + f[v][0][1] + f[v][1][1] + f[v][1][0]) %
                      998244353)) %
        998244353;
    f[x][1][1] = (f[x][1][1] *
                      ((f[v][0][0] + f[v][1][0] * 2 + f[v][0][1] + f[v][1][1]) %
                       998244353) %
                      998244353 +
                  tmp[0][1] * (f[v][0][0] + f[v][1][0])) %
                 998244353;
    for (long long j = 0; j < 2; ++j)
      for (long long k = 0; k < 2; ++k) f[x][j][k] %= 998244353;
  }
}
signed main() {
  n = read();
  for (long long i = 1; i < n; ++i) {
    long long x = read(), y = read();
    edge[x].push_back(y);
    edge[y].push_back(x);
  }
  dfs(1);
  printf("%lld\n",
         (f[1][1][0] + f[1][1][1] + f[1][0][0] - 1 + 998244353) % 998244353);
  return 0;
}
