#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10;
const int mod = 998244353;
int n;
int f[3][N];
vector<int> adj[N];
void add(int &x, const int &y) {
  x += y;
  x -= (x >= mod ? mod : 0);
}
void sub(int &x, const int &y) {
  x -= y;
  x += (x < 0 ? mod : 0);
}
int mul(const int &x, const int &y) { return 1ll * x * y % mod; }
void dfs(int u, int par) {
  f[0][u] = f[1][u] = f[2][u] = 1;
  for (int v : adj[u])
    if (v != par) {
      dfs(v, u);
      int tmp = 0;
      add(tmp, 2 * f[0][v] % mod);
      add(tmp, 2 * f[1][v] % mod);
      sub(tmp, f[2][v]);
      f[0][u] = mul(f[0][u], tmp);
      sub(tmp, f[1][v]);
      f[1][u] = mul(f[1][u], tmp);
      sub(tmp, f[0][v]);
      f[2][u] = mul(f[2][u], tmp);
    }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  adj[0].push_back(1);
  dfs(0, -1);
  sub(f[2][0], 1);
  printf("%d", f[2][0]);
}
