#include <bits/stdc++.h>
using namespace std;
void dfs(size_t node, const vector<vector<size_t> > &g, vector<bool> &visited,
         vector<bool> &gv, bool grp) {
  if (visited[node]) {
    return;
  }
  visited[node] = 1;
  gv[node] = grp;
  for (size_t p = 0; p < g[node].size(); p++) {
    size_t u = g[node][p];
    if (visited[u]) {
      continue;
    }
    dfs(u, g, visited, gv, 1 - grp);
  }
  return;
}
int main() {
  size_t n;
  cin >> n;
  vector<vector<size_t> > g(n);
  for (size_t p = 1; p < n; p++) {
    size_t x, y;
    cin >> x >> y;
    --x;
    --y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  vector<bool> visited(n, 0);
  vector<bool> gv(n, 0);
  dfs(0, g, visited, gv, 0);
  size_t a = 0;
  for (size_t p = 0; p < n; p++) {
    a += gv[p];
  }
  size_t b = n - a;
  size_t ans = a * b - (n - 1);
  cout << ans;
  return 0;
}
