#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
template <class S, class T>
ostream& operator<<(ostream& os, const pair<S, T>& p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
template <class T>
ostream& operator<<(ostream& os, const vector<T>& p) {
  os << "[ ";
  for (auto& it : p) os << it << " ";
  return os << "]";
}
template <class T>
ostream& operator<<(ostream& os, const unordered_set<T>& p) {
  os << "[ ";
  for (auto& it : p) os << it << " ";
  return os << "]";
}
template <class S, class T>
ostream& operator<<(ostream& os, const unordered_map<S, T>& p) {
  os << "[ ";
  for (auto& it : p) os << it << " ";
  return os << "]";
}
template <class T>
ostream& operator<<(ostream& os, const set<T>& p) {
  os << "[ ";
  for (auto& it : p) os << it << " ";
  return os << "]";
}
template <class T>
ostream& operator<<(ostream& os, const multiset<T>& p) {
  os << "[ ";
  for (auto& it : p) os << it << " ";
  return os << "]";
}
template <class S, class T>
ostream& operator<<(ostream& os, const map<S, T>& p) {
  os << "[ ";
  for (auto& it : p) os << it << " ";
  return os << "]";
}
template <class T>
void dbs(string str, T t) {
  cerr << str << " : " << t << "\n";
}
template <class T, class... S>
void dbs(string str, T t, S... s) {
  long long idx = str.find(',');
  cerr << str.substr(0, idx) << " : " << t << ",";
  dbs(str.substr(idx + 1), s...);
}
template <class T>
void prc(T a, T b) {
  cerr << "[";
  for (T i = a; i != b; ++i) {
    if (i != a) cerr << ", ";
    cerr << *i;
  }
  cerr << "]\n";
}
long long power(long long x, long long y) {
  long long res = 1;
  while (y) {
    if (y & 1) res = (res * x) % 998244353;
    y = y / 2, x = (x * x) % 998244353;
  }
  return res % 998244353;
}
vector<vector<long long> > arr(300001);
long long dp[300001][3];
void dfs(long long u, long long par) {
  dp[u][2] = 1;
  for (auto v : arr[u]) {
    if (v == par) continue;
    dfs(v, u);
    long long one =
        dp[u][0] * (dp[v][0] * 2 + dp[v][1] * 2 + dp[v][2] * 3) % 998244353 +
        dp[u][2] * (dp[v][0] + dp[v][1] + dp[v][2] * 2) % 998244353;
    long long two =
        dp[u][1] * (dp[v][0] * 2 + dp[v][1] + dp[v][2] * 2) % 998244353 +
        dp[u][2] * (dp[v][0] + dp[v][2]) % 998244353;
    long long three = dp[u][2] * (dp[v][0] + dp[v][1] + dp[v][2]) % 998244353;
    dp[u][0] = one % 998244353;
    dp[u][1] = two % 998244353;
    dp[u][2] = three % 998244353;
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  for (long long i = 0; i < (n - 1); ++i) {
    long long u, v;
    cin >> u >> v;
    arr[u].emplace_back(v);
    arr[v].emplace_back(u);
  }
  dfs(1, 0);
  cout << (dp[1][0] + dp[1][1] + dp[1][2] - 1 + 998244353) % 998244353;
}
