#include <bits/stdc++.h>
using namespace std;
long long n, m;
long long f[500005][3];
long long ans;
vector<long long> e[500005];
const long long p = 998244353;
inline void addEdge(long long u, long long v) { e[u].push_back(v); }
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -1;
    ch = getchar();
    if (ch == -1) return 0;
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
inline void write(long long x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x >= 10) write(x / 10);
  putchar(x % 10 + '0');
}
void dfs(long long u, long long fa) {
  f[u][0] = f[u][1] = f[u][2] = 1;
  for (long long v : e[u]) {
    if (v == fa) continue;
    dfs(v, u);
    long long x = (f[v][0] + f[v][1] - f[v][2] + p) % p;
    f[u][0] = 1ll * f[u][0] * (x + f[v][0] + f[v][1]) % p,
    f[u][1] = 1ll * f[u][1] * (x + f[v][0]) % p,
    f[u][2] = 1ll * f[u][2] * x % p;
  }
}
signed main() {
  n = read();
  for (long long i = 1, u, v; i <= n - 1; i++)
    u = read(), v = read(), addEdge(u, v), addEdge(v, u);
  dfs(1, 0);
  printf("%lld\n", (f[1][0] + f[1][1] - f[1][2] - 1 + p) % p);
  return 0;
}
