#include <bits/stdc++.h>
using namespace std;
void getint(int &v) {
  char ch, fu = 0;
  for (ch = '*'; (ch < '0' || ch > '9') && ch != '-'; ch = getchar())
    ;
  if (ch == '-') fu = 1, ch = getchar();
  for (v = 0; ch >= '0' && ch <= '9'; ch = getchar()) v = v * 10 + ch - '0';
  if (fu) v = -v;
}
bool leaf[500010];
long long ans;
int nedge, n, ts, x, y, son[500010], nxt[1000010], fa[500010], siz[500010],
    hed[500010], too[1000010];
struct node {
  long long p[2][2];
  node() { memset(p, 0, sizeof(p)); }
  void clear() { memset(p, 0, sizeof(p)); }
  node operator*(const node &A) {
    node B;
    B.p[0][0] |= p[0][0] & A.p[0][0];
    B.p[0][1] += p[0][0] * A.p[0][1];
    B.p[1][0] |= p[0][0] & A.p[1][0];
    B.p[1][1] += p[0][0] * A.p[1][1];
    B.p[0][1] += p[0][1] * A.p[0][0];
    B.p[1][1] += p[0][1] * A.p[1][0];
    B.p[1][0] |= p[1][0] & A.p[0][0];
    B.p[1][1] += p[1][0] * A.p[0][1];
    B.p[1][1] += p[1][0] * A.p[1][0] * 2;
    B.p[1][1] += p[1][1] * A.p[0][0];
    return B;
  }
  node re() {
    node A;
    A.p[0][0] = p[1][0];
    A.p[1][1] = p[1][0];
    A.p[0][1] = p[1][1];
    A.p[1][0] = p[0][0];
    A.p[1][1] += p[0][1];
    return A;
  }
} f[500010], g[500010], tmp[500010], L[500010], R[500010];
void ae(int x, int y) {
  nxt[++nedge] = hed[x];
  hed[x] = nedge;
  too[nedge] = y;
}
void dfs(int x) {
  leaf[x] = 1;
  siz[x] = 1;
  for (int i = hed[x]; i; i = nxt[i]) {
    int y = too[i];
    if (y == fa[x]) continue;
    leaf[x] = 0;
    fa[y] = x;
    dfs(y);
    siz[x] += siz[y];
  }
}
void dfs0(int x) {
  if (leaf[x]) {
    f[x].p[1][0] = 1;
    return;
  }
  for (int i = hed[x]; i; i = nxt[i]) {
    int y = too[i];
    if (y == fa[x]) continue;
    dfs0(y);
  }
  node t;
  t.p[0][0] = 1;
  for (int i = hed[x]; i; i = nxt[i]) {
    int y = too[i];
    if (y == fa[x]) continue;
    t = t * f[y];
  }
  f[x] = t.re();
}
void dfs1(int x) {
  ts = 0;
  for (int i = hed[x]; i; i = nxt[i]) {
    int y = too[i];
    if (y == fa[x]) continue;
    tmp[++ts] = f[y];
    son[ts] = y;
  }
  L[0].clear(), R[ts + 1].clear();
  L[0].p[0][0] = 1, R[ts + 1].p[0][0] = 1;
  for (int i = 1; i <= ts; ++i) L[i] = L[i - 1] * tmp[i];
  for (int i = ts; i >= 1; --i) R[i] = R[i + 1] * tmp[i];
  for (int i = 1; i <= ts; ++i) {
    node t = L[i - 1] * R[i + 1] * g[x];
    node w = L[1] * R[3];
    g[son[i]] = t.re();
  }
  for (int i = hed[x]; i; i = nxt[i]) {
    int y = too[i];
    if (y == fa[x]) continue;
    dfs1(y);
  }
}
int main() {
  scanf("%d", &n);
  if (n & 1) return puts("0"), 0;
  for (int i = 2; i <= n; ++i) {
    getint(x), getint(y);
    ae(x, y), ae(y, x);
  }
  dfs(1);
  dfs0(1);
  g[1].p[0][0] = 1;
  dfs1(1);
  for (int i = 2; i <= n; ++i)
    if (siz[i] % 2 == 0) {
      if (f[i].p[0][0] && g[i].p[0][0]) ans += (long long)siz[i] * (n - siz[i]);
    } else {
      ans += (f[i].p[0][1] + f[i].p[1][0]) * (g[i].p[0][1] + g[i].p[1][0]);
    }
  cout << ans << endl;
  return 0;
}
