#include <bits/stdc++.h>
using namespace std;
queue<int> q, usu;
int t1, nod, cul, viz[1000006], n, x, y;
vector<int> v[1000006];
void solve() {
  q.push(1);
  usu.push(1);
  ++t1;
  viz[1] = 1;
  while (!q.empty()) {
    nod = q.front();
    q.pop();
    cul = usu.front();
    usu.pop();
    for (int i = 0; i < v[nod].size(); ++i) {
      if (!viz[v[nod][i]]) {
        viz[v[nod][i]] = 1;
        if (cul == 1)
          usu.push(2);
        else {
          usu.push(1);
          ++t1;
        }
        q.push(v[nod][i]);
      }
    }
  }
}
int main() {
  cin >> n;
  for (int i = 1; i < n; ++i) {
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  solve();
  long long a, b;
  a = 1LL * t1;
  b = 1LL * (n - t1);
  long long sol = a * b - 1LL * n + 1LL;
  cout << sol;
  return 0;
}
