#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
const int N = 3e5 + 5, M = 998244353, INF = 0x3f3f3f3f;
void Main();
void dprint() { cerr << '\n'; }
template <typename T, typename... U>
void dprint(const T& x, const U&... y) {
  ((sizeof...(y) == 0) ? (cerr << x) : (cerr << x << ' '));
  dprint(y...);
}
template <typename T>
void dprint(const T& a, int l, int r, char c) {
  for (int i = l; i <= r; ++i) {
    cerr << a[i];
    if (i == r)
      cerr << '\n';
    else
      cerr << c;
  }
}
template <typename... U>
void debug(const U&... y) {
  cerr << "debug: ";
  dprint(y...);
};
void print() { cout << '\n'; }
template <typename T, typename... U>
void print(const T& x, const U&... y) {
  ((sizeof...(y) == 0) ? (cout << x) : (cout << x << ' '));
  print(y...);
}
template <typename T>
void print(const T& a, int l, int r, char c) {
  for (int i = l; i <= r; ++i) {
    cout << a[i];
    if (i == r)
      cout << '\n';
    else
      cout << c;
  }
}
void input() {}
template <typename T, typename... U>
void input(T& x, U&... y) {
  cin >> x;
  input(y...);
}
template <typename T>
void input(T& a, int l, int r, bool f) {
  for (int i = l; i <= r; ++i) cin >> a[i];
}
template <typename T>
void Max(T& a, T b) {
  a < b ? a = b : 1;
}
template <typename T>
void Min(T& a, T b) {
  a > b ? a = b : 1;
}
template <typename T>
void Add(T& a, T b) {
  a += b, a > M ? a -= M : 1;
}
template <typename T>
void Mul(T& a, T b) {
  a = a * b % M;
}
template <typename T>
T Mod(const T a) {
  return (a % M + M) % M;
}
int main(int argc, char** argv) {
  ios::sync_with_stdio(0), cin.tie(0);
  Main();
}
vector<int> G[N];
ll dp[3][N];
void dfs(int u, int fa) {
  dp[0][u] = dp[1][u] = dp[2][u] = 1;
  for (int v : G[u])
    if (v != fa) {
      dfs(v, u);
      ll x = Mod(dp[0][v] + dp[1][v] - dp[2][v]);
      Mul(dp[0][u], Mod(dp[0][v] + dp[1][v] + x));
      Mul(dp[1][u], Mod(dp[0][v] + x));
      Mul(dp[2][u], x);
    }
}
void Main() {
  int n;
  input(n);
  for (int i = 1, u, v; i < n; ++i)
    input(u, v), G[u].push_back(v), G[v].push_back(u);
  dfs(1, 1);
  print((dp[0][1] + dp[1][1] - dp[2][1] - 1 + M) % M);
}
