#include <bits/stdc++.h>
int head[500001], next[999999], to[999999], N, E, f[500001], g[500001],
    fc[500001], gc[500001], q[500001], fa[500001], size[500001];
long long O;
int I() {
  int r = 0, c;
  do c = getchar();
  while (c < 48 || c > 57);
  do r = (r << 3) + r + r + (c - 48), c = getchar();
  while (c > 47 && c < 58);
  return r;
}
int main() {
  if ((N = I()) & 1) {
    puts("0");
    return 0;
  }
  for (int i = 1; i < N; i++) {
    int u = I(), v = I();
    next[++E] = head[u], to[E] = v, head[u] = E;
    next[++E] = head[v], to[E] = u, head[v] = E;
  }
  int H = 0, T = 1, u;
  q[1] = 1;
  while (H < T)
    for (int e = head[u = q[++H]]; e; e = next[e])
      if (to[e] != fa[u]) fa[q[++T] = to[e]] = u;
  for (int i = N; i; i--) {
    int u = q[i], sn[4] = {0, 0, 0, 0}, sc[4] = {0, 0, 0, 0};
    size[u] = 1;
    for (int e = head[u]; e; e = next[e])
      if (to[e] != fa[u]) {
        size[u] += size[to[e]];
        sn[f[to[e]]]++;
        sc[f[to[e]]] += fc[to[e]];
      }
    if (sn[1] > 1 || sn[2] || sn[3])
      f[u] = size[u] & 1 | 2;
    else
      f[u] = !sn[1];
    if (size[u] & 1) {
      if (sn[2])
        fc[u] = sn[1] || sn[2] > 1 || sn[3] ? 0 : sc[2];
      else if (sn[3])
        fc[u] = sn[1] != 1 || sn[2] || sn[3] > 1 ? 0 : sc[3];
      else
        fc[u] = sn[1] > 2 ? 0 : (sn[1] == 2 ? sc[1] : sc[0] + 1);
    } else {
      if (sn[1] + sn[3] > 1 || sn[2])
        fc[u] = 0;
      else
        fc[u] = sc[sn[1] ? 1 : 3];
    }
  }
  for (int i = 1; i <= N; i++) {
    int u = q[i], sn[4] = {0, 0, 0, 0}, sc[4] = {0, 0, 0, 0};
    if (i > 1) {
      sn[g[u]]++;
      sc[g[u]] += gc[u];
    }
    for (int e = head[u]; e; e = next[e])
      if (to[e] != fa[u]) {
        sn[f[to[e]]]++;
        sc[f[to[e]]] += fc[to[e]];
      }
    for (int e = head[u]; e; e = next[e])
      if (to[e] != fa[u]) {
        sn[f[to[e]]]--;
        sc[f[to[e]]] -= fc[to[e]];
        if (sn[1] > 1 || sn[2] || sn[3])
          g[to[e]] = N - size[to[e]] & 1 | 2;
        else
          g[to[e]] = !sn[1];
        if (N - size[to[e]] & 1) {
          if (sn[2])
            gc[to[e]] = sn[1] || sn[2] > 1 || sn[3] ? 0 : sc[2];
          else if (sn[3])
            gc[to[e]] = sn[1] != 1 || sn[2] || sn[3] > 1 ? 0 : sc[3];
          else
            gc[to[e]] = sn[1] > 2 ? 0 : (sn[1] == 2 ? sc[1] : sc[0] + 1);
        } else {
          if (sn[1] + sn[3] > 1 || sn[2])
            gc[to[e]] = 0;
          else
            gc[to[e]] = sc[sn[1] ? 1 : 3];
        }
        sn[f[to[e]]]++;
        sc[f[to[e]]] += fc[to[e]];
      }
  }
  for (int i = 2; i <= N; i++)
    if (size[i] & 1)
      O += (long long)fc[i] * gc[i];
    else if (f[i] == 0 && g[i] == 0)
      O += (long long)size[i] * (N - size[i]);
  printf("%lld\n", O);
  return 0;
}
