#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void cmin(T &a, T b) {
  if (a > b) a = b;
}
template <class T>
inline void cmax(T &a, T b) {
  if (a < b) a = b;
}
char IO;
int rd() {
  int s = 0;
  int f = 0;
  while (!isdigit(IO = getchar()))
    if (IO == '-') f = 1;
  do s = (s << 1) + (s << 3) + (IO ^ '0');
  while (isdigit(IO = getchar()));
  return f ? -s : s;
}
const int N = 3e5 + 10, P = 998244353;
int n;
struct Edge {
  int to, nxt;
} e[N << 1];
int head[N], ecnt;
void AddEdge(int u, int v) {
  e[++ecnt] = (Edge){v, head[u]};
  head[u] = ecnt;
}
long long dp[N][2][2], tmp[2][2];
void dfs(int u, int f) {
  dp[u][0][0] = dp[u][0][1] = 1;
  for (register int i = head[u]; i; i = e[i].nxt) {
    int v = e[i].to;
    if (v == f) continue;
    dfs(v, u);
    memset(tmp, 0, sizeof tmp);
    for (int a = 0, aend = 1; a <= aend; ++a)
      for (int b = 0, bend = 1; b <= bend; ++b) {
        for (int c = 0, cend = 1; c <= cend; ++c)
          for (int d = 0, dend = 1; d <= dend; ++d) {
            if (!b || !d)
              tmp[1][b] = (tmp[1][b] + dp[u][a][b] * dp[v][c][d]) % P;
            if (c || !d)
              tmp[a][b] = (tmp[a][b] + dp[u][a][b] * dp[v][c][d]) % P;
          }
      }
    memcpy(dp[u], tmp, sizeof dp[u]);
  }
}
int main() {
  n = rd();
  for (int i = 2, iend = n; i <= iend; ++i) {
    int u = rd(), v = rd();
    AddEdge(u, v), AddEdge(v, u);
  }
  dfs(1, 0);
  long long ans = (P + dp[1][0][0] + dp[1][1][0] + dp[1][1][1] - 1) % P;
  printf("%lld\n", ans);
}
