#include <bits/stdc++.h>
using namespace std;
int n, m, cnt, x1[500010], r[2 * 500010], vt[2 * 500010], d[500010], tot,
    su[500010];
long long ans;
void adde(int a, int b) {
  r[++cnt] = x1[a];
  x1[a] = cnt;
  vt[cnt] = b;
  r[++cnt] = x1[b];
  x1[b] = cnt;
  vt[cnt] = a;
}
struct node {
  long long v[2][2];
  node operator^(node const &a) const {
    int i, s, j, k;
    node b;
    for (i = 0; i < 2; i++)
      for (s = 0; s < 2; s++) b.v[i][s] = 0;
    b.v[0][0] += v[0][0] * a.v[0][0];
    b.v[0][1] += v[0][0] * a.v[0][1];
    b.v[0][1] += v[0][0] * a.v[1][0];
    b.v[0][1] += v[0][1] * a.v[0][0];
    b.v[1][0] += v[1][0] * a.v[0][0];
    b.v[1][1] += v[1][0] * a.v[0][1];
    b.v[0][0] += v[1][0] * a.v[1][0];
    b.v[1][1] += v[1][0] * a.v[1][0];
    b.v[0][1] += v[1][0] * a.v[1][1];
    b.v[1][1] += v[1][1] * a.v[0][0];
    b.v[0][1] += v[1][1] * a.v[1][0];
    if (b.v[0][0]) b.v[0][0] = 1;
    if (b.v[1][0]) b.v[1][0] = 1;
    return b;
  }
  node operator+(node const &a) const {
    int i, s, j, k;
    node b;
    for (i = 0; i < 2; i++)
      for (s = 0; s < 2; s++) b.v[i][s] = 0;
    b.v[1][0] += v[1][0] * a.v[1][0];
    b.v[1][1] += v[1][0] * a.v[1][1] + v[1][1] * a.v[1][0];
    b.v[0][0] += v[1][0] * a.v[0][0];
    b.v[0][1] += v[1][0] * a.v[0][1] + v[1][1] * a.v[0][0];
    b.v[0][0] += v[0][0] * a.v[1][0];
    b.v[0][1] += v[0][0] * a.v[1][1] + v[0][1] * a.v[1][0];
    if (b.v[0][0]) b.v[0][0] = 1;
    if (b.v[1][0]) b.v[1][0] = 1;
    return b;
  }
} f[500010], g[500010], fo[500010], la[500010], rt;
void dfs1(int i, int fa) {
  int s, a, b, j, k;
  f[i] = rt;
  a = x1[i];
  su[i] = 1;
  while (a) {
    b = vt[a];
    if (b != fa) dfs1(b, i), f[i] = f[i] ^ f[b], su[i] += su[b];
    a = r[a];
  }
}
void dfs2(int i, int fa) {
  int s, a, b, j, k;
  if (g[i].v[0][0] && f[i].v[0][0])
    ans += (long long)su[i] * (n - su[i]);
  else
    ans += (g[i].v[0][1] + g[i].v[1][0]) * (f[i].v[1][0] + f[i].v[0][1]);
  cnt = 0;
  a = x1[i];
  while (a) {
    b = vt[a];
    if (b != fa) d[++cnt] = b;
    a = r[a];
  }
  fo[0] = rt ^ g[i];
  la[cnt + 1] = rt;
  for (s = 1; s <= cnt; s++) fo[s] = fo[s - 1] ^ f[d[s]];
  for (s = cnt; s; s--) la[s] = la[s + 1] ^ f[d[s]];
  for (s = 1; s < cnt; s++) {
    g[d[s]] = fo[s - 1] + la[s + 1];
  }
  g[d[s]] = fo[s - 1];
  a = x1[i];
  while (a) {
    b = vt[a];
    if (b != fa) dfs2(b, i);
    a = r[a];
  }
}
int main() {
  int i, s, a, b, j, k;
  rt.v[1][0] = 1;
  scanf("%d", &n);
  for (i = 1; i < n; i++) scanf("%d%d", &a, &b), adde(a, b);
  dfs1(1, 0);
  a = x1[1];
  cnt = 0;
  while (a) d[++cnt] = vt[a], a = r[a];
  fo[0] = la[cnt + 1] = rt;
  for (s = 1; s <= cnt; s++) fo[s] = fo[s - 1] ^ f[d[s]];
  for (s = cnt; s; s--) la[s] = la[s + 1] ^ f[d[s]];
  g[d[1]] = la[2];
  g[d[cnt]] = fo[cnt - 1];
  for (s = 2; s < cnt; s++) g[d[s]] = fo[s - 1] + la[s + 1];
  a = x1[1];
  while (a) b = vt[a], dfs2(b, 1), a = r[a];
  printf("%I64d", ans);
  return 0;
}
