#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll LINF = 1001002003004005006ll;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
template <ll Mod>
struct ModInt {
  long long x;
  ModInt() : x(0) {}
  ModInt(long long y) : x(y >= 0 ? y % Mod : (Mod - (-y) % Mod) % Mod) {}
  ModInt &operator+=(const ModInt &p) {
    if ((x += p.x) >= Mod) x -= Mod;
    return *this;
  }
  ModInt &operator-=(const ModInt &p) {
    if ((x += Mod - p.x) >= Mod) x -= Mod;
    return *this;
  }
  ModInt &operator*=(const ModInt &p) {
    x = (int)(1ll * x * p.x % Mod);
    return *this;
  }
  ModInt &operator/=(const ModInt &p) {
    (*this) *= p.inverse();
    return *this;
  }
  ModInt operator-() const { return ModInt(x); }
  ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }
  ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }
  ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }
  ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }
  ModInt operator==(const ModInt &p) const { return x == p.x; }
  ModInt operator!=(const ModInt &p) const { return x != p.x; }
  ModInt inverse() const {
    int a = x, b = Mod, u = 1, v = 0, t;
    while (b > 0) {
      t = a / b;
      swap(a -= t * b, b);
      swap(u -= t * v, v);
    }
    return ModInt(u);
  }
  ModInt pow(long long n) const {
    ModInt ret(1), mul(x);
    while (n > 0) {
      if (n & 1) ret *= mul;
      mul *= mul;
      n >>= 1;
    }
    return ret;
  }
  friend ostream &operator<<(ostream &os, const ModInt &p) { return os << p.x; }
  friend istream &operator>>(istream &is, ModInt &a) {
    long long t;
    is >> t;
    a = ModInt<Mod>(t);
    return (is);
  }
  static int get_mod() { return Mod; }
};
using mint = ModInt<998244353>;
int n;
vector<vector<int>> g;
struct node {
  mint ha, nuru, nuranai;
  node(mint ha, mint nuru, mint nuranai)
      : ha(ha), nuru(nuru), nuranai(nuranai) {}
  node() {}
};
void o(node &p) {
  cout << "ha : " << p.ha << " , nuru : " << p.nuru
       << " , nuranai : " << p.nuranai << endl;
}
node dfs(int pre, int now) {
  if (pre >= 0 and g[now].size() == 1) {
    return node(mint(0), mint(0), mint(0));
  }
  node ret(mint(1), mint(1), mint(1));
  for (auto to : g[now])
    if (pre != to) {
      auto ch = dfs(now, to);
      ret.ha *= ch.nuru + ch.nuranai + ch.ha + 1;
      ret.nuru *=
          ch.nuranai + 1 + ch.ha + (ch.ha + ch.nuranai + ch.nuru + mint(1));
      ret.nuranai *= ch.nuru + ch.nuranai + ch.ha + ch.ha +
                     (ch.nuru + ch.ha + ch.nuranai) + mint(3);
    }
  ret.nuru -= ret.ha;
  ret.nuranai -= ret.ha;
  ret.ha -= 1;
  return ret;
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  cin >> n;
  g.resize(n);
  for (int i = 0; i < (n - 1); i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  auto res = dfs(-1, 0);
  mint ans = res.ha + res.nuranai + res.nuru;
  cout << ans << endl;
  return 0;
}
