#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
vector<int> edges[300007];
bool vis[300007];
struct kk {
  long long a, b, c;
  bool leaf;
} dp[300007];
void dfs(int index) {
  vis[index] = true;
  long long cb = 1, ab = 1, leicheng = 1, leicheng1 = 1, num = 0;
  bool allleaf = true;
  dp[index].leaf = true;
  for (auto cxx : edges[index]) {
    if (!vis[cxx]) {
      dp[index].leaf = false;
      dfs(cxx);
      ++num;
      cb = cb * (dp[cxx].c + dp[cxx].b) % mod;
      ab = ab * (dp[cxx].a + dp[cxx].b) % mod;
      leicheng = leicheng * dp[cxx].b % mod;
      leicheng1 = leicheng1 * (dp[cxx].b - 1) % mod;
      if (!dp[cxx].leaf) allleaf = false;
    }
  }
  if (dp[index].leaf) {
    dp[index].a = 2;
    dp[index].b = 1;
    dp[index].c = 1;
  } else {
    long long tmp = 0;
    if (allleaf) tmp = leicheng;
    dp[index].b = ((cb + ab - leicheng - 1) % mod + mod + 1) % mod;
    dp[index].c = ab % mod;
    dp[index].a = (ab + cb) % mod;
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i < n; ++i) {
    int d, e;
    cin >> d >> e;
    edges[d].push_back(e);
    edges[e].push_back(d);
  }
  if (n == 1) {
    cout << 0;
    return 0;
  }
  dfs(1);
  cout << (dp[1].b - 1) % mod;
}
