#include <bits/stdc++.h>
using namespace std;
long long fir[300010], nxt[600010], son[600010], tot;
long long n, f[300010][3], vis[300010], ans;
void add(long long x, long long y) {
  ++tot;
  nxt[tot] = fir[x];
  fir[x] = tot;
  son[tot] = y;
}
inline void DFS(long long x) {
  vis[x] = 1;
  f[x][2] = 1;
  for (long long to, i = fir[x]; i; i = nxt[i]) {
    to = son[i];
    if (vis[to]) continue;
    DFS(to);
    f[x][0] = ((f[x][0] + f[x][2]) % 998244353 *
                   (f[to][0] + f[to][1] + f[to][2] * 2ll) % 998244353 +
               f[x][0] % 998244353 * (1ll * f[to][0] + f[to][1] + f[to][2]) %
                   998244353) %
              998244353;
    f[x][1] = (1ll * (f[x][1] + f[x][2]) % 998244353 * (f[to][0] + f[to][2]) %
                   998244353 +
               f[x][1] * (1ll * f[to][0] + f[to][1] + f[to][2]) % 998244353) %
              998244353;
    f[x][2] = f[x][2] % 998244353 * (1ll * f[to][0] + f[to][1] + f[to][2]) %
              998244353;
  }
}
signed main() {
  cin >> n;
  for (long long x, y, i = 1; i < n; i++) {
    cin >> x >> y;
    add(x, y);
    add(y, x);
  }
  DFS(1);
  ans = 1ll * f[1][0] + f[1][1] + f[1][2] - 1;
  ans %= 998244353;
  cout << ans << endl;
  return 0;
}
