#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> E[300000 + 5];
void add_edge(int u, int v) {
  E[u].push_back(v);
  E[v].push_back(u);
}
long long f[300000 + 5][3];
void dfs(int x, int fa) {
  f[x][0] = f[x][1] = f[x][2] = 1;
  for (int y : E[x]) {
    if (y != fa) {
      dfs(y, x);
      long long delf = (f[y][0] + f[y][1] - f[y][2] + 998244353) % 998244353;
      f[x][0] = f[x][0] * (f[y][0] + f[y][1] + delf) % 998244353;
      f[x][1] = f[x][1] * (f[y][0] + delf) % 998244353;
      f[x][2] = f[x][2] * delf % 998244353;
    }
  }
}
int main() {
  int u, v;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d %d", &u, &v);
    add_edge(u, v);
  }
  dfs(1, 0);
  long long ans = (f[1][0] + f[1][1] - f[1][2] - 1 + 998244353) % 998244353;
  printf("%lld\n", ans);
}
