#include <bits/stdc++.h>
using namespace std;
const int maxn = 300100, mod = 998244353;
inline void Add(int &a, int b) { a = a + b >= mod ? a + b - mod : a + b; }
int head[maxn], nxt[maxn << 1], ver[maxn << 1], tot;
inline void addedge(int a, int b) {
  nxt[++tot] = head[a];
  ver[tot] = b;
  head[a] = tot;
  nxt[++tot] = head[b];
  ver[tot] = a;
  head[b] = tot;
}
int n, f[maxn][2], g[maxn][2], h[maxn];
inline void treedp(int x, int fat) {
  f[x][0] = f[x][1] = g[x][0] = g[x][1] = h[x] = 1;
  for (int i = head[x]; i; i = nxt[i]) {
    int y = ver[i];
    if (y == fat) continue;
    treedp(y, x);
    f[x][0] = (0ll + f[y][0] + f[y][1] + g[y][0] + g[y][1] + h[y]) % mod *
              f[x][0] % mod;
    f[x][1] = (0ll + f[y][0] + g[y][0] + g[y][1] + h[y]) % mod * f[x][1] % mod;
    h[x] = (0ll + g[y][0] + g[y][1] + h[y]) % mod * h[x] % mod;
  }
  g[x][0] = (f[x][0] + mod - h[x]) % mod;
  g[x][1] = (f[x][1] + mod - h[x]) % mod;
}
int main() {
  scanf("%d", &n);
  for (int i = 1, a, b; i < n; i++) scanf("%d%d", &a, &b), addedge(a, b);
  treedp(1, 0);
  int ans = (0ll + g[1][0] + g[1][1] + h[1] - 1 + mod) % mod;
  cout << ans << endl;
}
