#include <bits/stdc++.h>
using namespace std;
const long double pi = acos(-1);
const int oo = 1 << 30;
const long long OO = 1e18;
const int N = 5e5 + 100;
int gi() {
  int w = 0;
  bool q = 1;
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  if (c == '-') q = 0, c = getchar();
  while (c >= '0' && c <= '9') w = w * 10 + c - '0', c = getchar();
  return q ? w : -w;
}
vector<int> v[N];
struct M {
  long long v[2][2];
} f[N], g[N], L[N], R[N];
int siz[N], n;
const M uni = (M){1, 0, 0, 1};
inline M up(const M &v) {
  return (M){v.v[1][0], v.v[1][1], v.v[0][0], v.v[0][1]};
}
inline M operator+(const M &a, const M &b) {
  M ans = {};
  for (int i = 0; i < 2; i++)
    for (int j = 0; j < 2; j++)
      for (int k = 0; i + k < 2; k++)
        for (int t = 0; j + t < 2; t++)
          ans.v[i + k][j + t] += a.v[i][j] * b.v[k][t];
  return ans;
}
inline void dfs1(int k) {
  f[k] = uni;
  siz[k] = 1;
  for (int t : v[k]) {
    v[t].erase(find(v[t].begin(), v[t].end(), k));
    dfs1(t);
    siz[k] += siz[t];
    f[k] = f[k] + up(f[t]);
  }
}
long long ans;
inline void dfs2(int k) {
  int m = v[k].size(), i;
  if (!m) return;
  L[0] = up(f[v[k][0]]), R[m - 1] = up(f[v[k][m - 1]]);
  for (i = 1; i < m; i++) L[i] = L[i - 1] + up(f[v[k][i]]);
  for (i = m - 2; ~i; i--) R[i] = R[i + 1] + up(f[v[k][i]]);
  M t;
  for (i = 0; i < m; i++) {
    t = g[k];
    if (i) t = t + L[i - 1];
    if (i < m - 1) t = t + R[i + 1];
    ans += t.v[1][0] * f[v[k][i]].v[1][0] * siz[v[k][i]] * (n - siz[v[k][i]]) +
           t.v[1][1] * f[v[k][i]].v[1][1];
    g[v[k][i]] = uni + up(t);
  }
  for (int p : v[k]) dfs2(p);
}
int main() {
  int i, a, b;
  n = gi();
  for (i = 1; i < n; i++) {
    a = gi(), b = gi();
    v[a].push_back(b), v[b].push_back(a);
  }
  dfs1(1);
  g[1] = uni;
  dfs2(1);
  cout << ans << endl;
  return 0;
}
