#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 10;
int gi() {
  int x = 0, o = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') o = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x * o;
}
int n;
long long ans = 0;
vector<int> E[N];
void addedge(int u, int v) {
  E[u].push_back(v);
  E[v].push_back(u);
}
struct data {
  int val[2][2];
  data() { memset(val, 0, sizeof(val)); }
  data(int x, int y, int z, int w) {
    val[0][0] = x, val[0][1] = y, val[1][0] = z, val[1][1] = w;
  }
  int* operator[](int x) { return val[x]; }
  const int* operator[](int x) const { return val[x]; }
  data trans() {
    return data(val[1][0], val[0][0] + val[1][1], val[0][0], val[0][1]);
  }
  data operator+(const data& x) const {
    data ret;
    for (int i = 0; i < 2; i++)
      for (int j = 0; j < 2; j++)
        for (int k = 0; k + i < 2; k++)
          for (int l = 0; l + j < 2; l++)
            ret[i + k][j + l] += val[i][j] * x[k][l];
    return ret;
  }
  void print() {
    for (int i = 0; i < 2; i++)
      for (int j = 0; j < 2; j++) cerr << val[i][j] << " ";
    cerr << endl;
  }
} f[N], g[N];
int sz[N];
void dp1(int u, int fa) {
  f[u] = data(1, 0, 0, 0);
  sz[u] = 1;
  for (int v : E[u])
    if (v != fa) dp1(v, u), f[u] = f[u] + f[v].trans(), sz[u] += sz[v];
}
void dp2(int u, int fa) {
  data cur(1, 0, 0, 0);
  vector<data> pre;
  if (fa) {
    pre.push_back(g[u].trans());
    E[u].erase(find(E[u].begin(), E[u].end(), fa));
  } else
    pre.push_back(cur);
  for (auto v : E[u]) pre.push_back(pre.back() + f[v].trans());
  for (int i = E[u].size() - 1; ~i; i--) {
    int v = E[u][i];
    g[v] = cur + pre[i], cur = cur + f[v].trans(), dp2(v, u);
  }
}
int main() {
  ios::sync_with_stdio(0);
  n = gi();
  if (n & 1) return puts("0"), 0;
  for (int i = 1, u, v; i < n; i++) u = gi(), v = gi(), addedge(u, v);
  dp1(1, 0), dp2(1, 0);
  for (int i = 2; i <= n; i++) {
    if (f[i][1][0] && g[i][1][0])
      ans += 1ll * sz[i] * (n - sz[i]);
    else
      ans += 1ll * (f[i][0][0] + f[i][1][1]) * (g[i][0][0] + g[i][1][1]);
  }
  cout << ans;
  return 0;
}
