#include <bits/stdc++.h>
using namespace std;
long long n;
vector<long long> g[300001];
long long dp[300001][3];
const long long mod = 998244353LL;
long long parent[300001];
long long mul(long long x, long long y) {
  return ((x % mod) * (y % mod)) % mod;
}
long long add(long long x, long long y) {
  return ((x % mod) + (y % mod)) % mod;
}
long long sub(long long x, long long y) {
  return ((x % mod) + mod - (y % mod)) % mod;
}
long long rec(long long x, long long parent_info) {
  if (dp[x][parent_info] != -1) return dp[x][parent_info];
  dp[x][parent_info] = 0;
  if (g[x].size() == 1 && x != 1) {
    if (parent_info == 0)
      dp[x][parent_info] = 1;
    else if (parent_info == 1)
      dp[x][parent_info] = 2;
    else
      dp[x][parent_info] = 1;
    return dp[x][parent_info];
  }
  long long leave = 1;
  long long take = 1;
  long long forbidden = 0;
  if (parent_info == 2) take = 0;
  if (parent_info == 0) forbidden = 1;
  for (auto s : g[x]) {
    if (parent[x] == s) continue;
    parent[s] = x;
    if (parent_info != 2) take = mul(take, add(rec(s, 0), rec(s, 2)));
    leave = mul(leave, add(rec(s, 0), rec(s, 1)));
    if (parent_info == 0) forbidden = mul(forbidden, rec(s, 0));
  }
  dp[x][parent_info] = sub(add(take, leave), forbidden);
  return dp[x][parent_info];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (long long i = 1; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  for (long long i = 1; i <= n; i++) {
    for (long long j = 0; j < 3; j++) dp[i][j] = -1;
  }
  cout << rec(1, 0) - 1;
  return 0;
}
