#include <bits/stdc++.h>
using namespace std;
const long long MX = 3e5;
const long long MOD = 998244353;
long long mult(long long a, long long b) { return (a * b) % MOD; }
long long add(long long a, long long b) { return (a + b) % MOD; }
struct Graph {
  vector<long long> adj[MX];
  long long dp[MX][3];
  bool used[MX][3];
  void addEdge(long long u, long long v) {
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  long long dfs(long long u = 0, long long state = 2, long long p = -1) {
    if (used[u][state]) {
      return dp[u][state];
    }
    used[u][state] = true;
    long long ans = 0;
    long long limit = 1;
    if (state == 1) {
      limit = 0;
    }
    for (long long cur = 0; cur <= limit; cur++) {
      long long partial = 1;
      long long minus = 1;
      for (long long v : adj[u]) {
        if (v == p) continue;
        partial = mult(partial, add(dfs(v, cur, u), dfs(v, 2, u)));
        minus = mult(minus, dfs(v, 2, u));
      }
      if (state == 2 && cur == 1) {
        partial = add(partial, MOD - minus);
      }
      ans = add(ans, partial);
    }
    return dp[u][state] = ans;
  }
} G;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  for (long long i = 0; i < (long long)n - 1; i++) {
    long long u, v;
    cin >> u >> v;
    u--;
    v--;
    G.addEdge(u, v);
  }
  cout << add(G.dfs(), MOD - 1) << endl;
  return 0;
}
