#include <bits/stdc++.h>
using namespace std;
void onlinejudge() {}
int main() {
  onlinejudge();
  long long n;
  cin >> n;
  if (n < 4) {
    cout << 0;
    return 0;
  }
  long long i;
  long long u, v;
  vector<long long> adj[n + 1];
  for (i = 1; i <= n - 1; i++) {
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  queue<long long> q;
  q.push(1);
  q.push(-1);
  long long cnt[n + 2];
  memset(cnt, 0, sizeof(cnt));
  cnt[1] = 1;
  long long z = 2;
  bool visited[n + 1];
  memset(visited, false, sizeof(visited));
  while (!q.empty()) {
    v = q.front();
    q.pop();
    visited[v] = true;
    for (int u : adj[v]) {
      if (visited[u] == false) {
        q.push(u);
        visited[u] = true;
      }
    }
    if (q.front() == -1) {
      q.pop();
      if (!q.empty()) {
        q.push(-1);
        cnt[z++] = q.size() - 1;
      }
    }
  }
  long long sum1 = 0, sum2 = 0;
  for (i = 1; i <= n; i += 2) {
    sum1 += cnt[i];
  }
  for (i = 2; i <= n; i += 2) {
    sum2 += cnt[i];
  }
  cout << sum1 * sum2 - n + 1;
  return 0;
}
