#include <bits/stdc++.h>
using namespace std;
void fun() {
  int n;
  cin >> n;
  map<int, list<int>> m;
  int v1, v2;
  for (int i = 0; i < n - 1; i++) {
    cin >> v1 >> v2;
    m[v1].push_back(v2);
    m[v2].push_back(v1);
  }
  bool v[n + 1];
  int V[n + 1];
  for (int i = 0; i < n + 1; i++) {
    v[i] = false;
    V[i] = 0;
  }
  int node = 1;
  queue<int> q;
  bool s = true;
  ;
  v[1] = s;
  V[1] = 1;
  while (true) {
    s = !v[node];
    for (auto itr : m[node]) {
      if (V[itr] == 0) {
        V[itr] = 1;
        v[itr] = s;
        q.push(itr);
      }
    }
    if (q.empty()) {
      break;
    } else {
      node = q.front();
      q.pop();
    }
  }
  int one = 0;
  int two = 0;
  for (int i = 1; i <= n; i++) {
    if (v[i] == true)
      one++;
    else
      two++;
  }
  long long k = 0;
  for (int i = 1; i <= n; i++) {
    {
      if (v[i] == true) k += two - m[i].size();
    }
  }
  cout << k << endl;
}
int main() {
  { fun(); }
  return 0;
}
