#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
const int N = 1e6 + 10;
const long long mod = 1e9 + 7;
const long long mod2 = 998244353;
const long long inf = 8e18;
const int LOG = 22;
long long pw(long long a, long long b, long long M) {
  return (!b ? 1
             : (b & 1 ? (a * pw(a * a % M, b / 2, M)) % M
                      : pw(a * a % M, b / 2, M)));
}
int H[N], sz[N], dp_down[N], dp_up[N];
bool is_OK_down[N], is_OK_up[N];
vector<int> G[N];
vector<pair<int, int> > E;
void dfs_down(int v, int par = 0) {
  H[v] = H[par] + 1;
  int odd = 0, OK = 1, not_OK = 0;
  sz[v]++;
  for (auto u : G[v]) {
    if (u == par) continue;
    dfs_down(u, v);
    OK *= is_OK_down[u];
    not_OK += (1 - is_OK_down[u]);
    sz[v] += sz[u];
    odd += (sz[u] % 2);
  }
  if (sz[v] % 2 == 0) {
    is_OK_down[v] = (odd == 1 && OK == 1);
  } else {
    is_OK_down[v] = (odd == 0 && OK == 1);
    dp_down[v] += is_OK_down[v];
  }
  for (auto u : G[v]) {
    if (u == par) continue;
    not_OK += (is_OK_down[u] - 1);
    odd += ((sz[u] % 2) ? -1 : +1);
    if (not_OK == 0 &&
        ((sz[v] % 2) == 1 && odd == 1 || (sz[v] % 2) == 0 && odd == 0)) {
      dp_down[v] += dp_down[u];
    }
    odd -= ((sz[u] % 2) ? -1 : +1);
    not_OK += (1 - is_OK_down[u]);
  }
}
void dfs_up(int v, int par = 0) {
  int Ans[2][4];
  memset(Ans, 0, sizeof Ans);
  int not_OK = 0, odd = 0;
  not_OK += (1 - is_OK_up[v]);
  odd += sz[v] % 2;
  for (auto u : G[v]) {
    if (u == par) continue;
    odd += sz[u] % 2;
    not_OK += (1 - is_OK_down[u]);
  }
  odd += ((sz[v] % 2) ? -1 : +1);
  not_OK += (is_OK_up[v] - 1);
  if (not_OK < 2 && odd < 4) {
    Ans[not_OK][odd] += dp_up[v];
  }
  odd -= ((sz[v] % 2) ? -1 : +1);
  not_OK -= (is_OK_up[v] - 1);
  for (auto u : G[v]) {
    if (u == par) continue;
    odd -= (sz[u] % 2);
    not_OK += (is_OK_down[u] - 1);
    if (not_OK == 0 &&
        ((sz[u] % 2 == 1) && odd == 0 || (sz[u] % 2) == 0 && odd == 1)) {
      is_OK_up[u] = 1;
      if (sz[u] % 2) {
        dp_up[u]++;
      }
    }
    odd += (sz[u] % 2);
    odd += ((sz[u] % 2) ? -1 : +1);
    if (not_OK < 2 && odd < 4) {
      Ans[not_OK][odd] += dp_down[u];
    }
    odd -= ((sz[u] % 2) ? -1 : +1);
    not_OK -= (is_OK_down[u] - 1);
  }
  for (auto u : G[v]) {
    if (u == par) continue;
    odd += ((sz[u] % 2) ? -1 : +1);
    not_OK += (is_OK_down[u] - 1);
    if (not_OK < 2 && odd < 4) {
      Ans[not_OK][odd] -= dp_down[u];
    }
    if (sz[u] % 2) {
      dp_up[u] += Ans[1 - is_OK_down[u]][2];
    } else {
      dp_up[u] += Ans[1 - is_OK_down[u]][0];
    }
    dfs_up(u, v);
    if (not_OK < 2 && odd < 4) {
      Ans[not_OK][odd] += dp_down[u];
    }
    odd -= ((sz[u] % 2) ? -1 : +1);
    not_OK -= (is_OK_down[u] - 1);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    int a, b;
    cin >> a >> b;
    G[a].push_back(b);
    G[b].push_back(a);
    E.push_back(make_pair(a, b));
  }
  if (n % 2) {
    return cout << 0, 0;
  }
  dfs_down(1);
  is_OK_up[1] = 1;
  dfs_up(1);
  long long ans = 0;
  for (auto x : E) {
    int a = x.first, b = x.second;
    if (H[b] > H[a]) swap(a, b);
    if ((sz[a] % 2) == 0 && is_OK_down[1]) {
      ans += (1ll) * sz[a] * (n - sz[a]);
    } else if (sz[a] % 2) {
      ans += (1ll) * dp_down[a] * dp_up[a];
    }
  }
  cout << ans << "\n";
  return 0;
}
