#include <bits/stdc++.h>
using namespace std;
namespace sky_chen {
char buf[1 << 23], *p1 = buf, *p2 = buf, obuf[1 << 23], *O = obuf;
inline long long read() {
  long long ans = 0, f = 1;
  char a =
      p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2)
          ? EOF
          : *p1++;
  while (a > '9' || a < '0') {
    if (a == '-') f = -1;
    a = p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2)
            ? EOF
            : *p1++;
  }
  while (a >= '0' && a <= '9')
    ans = ans * 10 + (a ^ 48),
    a = p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2)
            ? EOF
            : *p1++;
  return ans * f;
}
inline char red() {
  long long ans = 0;
  char a = getchar();
  while (a > 'z' || a < 'a') a = getchar();
  return a;
}
inline void p(long long x) {
  if (x < 0) return (void)(*O++ = '-', p(-x));
  if (x > 9) p(x / 10);
  *O++ = x % 10 + '0';
}
inline void cadd(long long &x, long long y) { x = (x + y) % 998244353; }
inline void cmul(long long &x, long long y) { x = x * y % 998244353; }
inline void cmin(long long &x, long long y) { x = min(x, y); }
inline void cmax(long long &x, long long y) { x = max(x, y); }
long long qpow(long long n, long long base = 998244353 - 2) {
  long long ans = 1;
  while (base) {
    if (base & 1) ans = ans * n % 998244353;
    n = n * n % 998244353;
    base >>= 1;
  }
  return ans;
}
void print(long long a, long long b) { p(b); }
const int maxn = 3e5 + 5;
long long n, csp = 1, first[maxn], dp[maxn][3];
struct edge {
  long long to, nxt;
} e[2 * maxn];
void add(long long u, long long v) {
  e[++csp] = edge{v, first[u]};
  first[u] = csp;
}
void dfs(long long now, long long fa) {
  dp[now][0] = dp[now][1] = dp[now][2] = 1;
  for (int i = first[now]; i; i = e[i].nxt) {
    long long v = e[i].to;
    if (v == fa) continue;
    dfs(v, now);
    cmul(dp[now][0], dp[v][0]);
    cmul(dp[now][1], dp[v][0] + dp[v][1] + dp[v][2]);
    cmul(dp[now][2], dp[v][0] + dp[v][1]);
  }
  dp[now][0] = (dp[now][1] + dp[now][2] - dp[now][0] + 998244353) % 998244353;
}
int yyds() {
  n = read();
  for (int i = 1; i <= n - 1; i++) {
    long long u = read(), v = read();
    add(u, v);
    add(v, u);
  }
  dfs(1, -1);
  print(114514, (dp[1][0] - 1 + 998244353) % 998244353);
  fwrite(obuf, 1, O - obuf, stdout);
  return 0;
}
}  // namespace sky_chen
int main() { return sky_chen::yyds(); }
