#include <bits/stdc++.h>
using namespace std;
void bipartite(vector<int> &v1, vector<int> &v2, vector<bool> &vis, int n,
               vector<int> adj[]) {
  vector<bool> color(n + 1, -1);
  queue<int> q;
  q.push(1);
  vis[1] = true;
  color[1] = 0;
  v1.push_back(1);
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    for (int i = 0; i < adj[x].size(); i++) {
      int y = adj[x][i];
      if (vis[y] == false) {
        color[y] = 1 - color[x];
        vis[y] = true;
        q.push(y);
        if (color[y] == 1)
          v2.push_back(y);
        else
          v1.push_back(y);
      }
    }
  }
}
int main() {
  int n;
  cin >> n;
  vector<int> adj[n + 1];
  int temp = n - 1;
  while (temp--) {
    int x, y;
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  vector<int> v1, v2;
  vector<bool> vis(n + 1, false);
  bipartite(v1, v2, vis, n, adj);
  for (int i = 1; i <= n; i++) {
    if (vis[i] == false) {
      if (v1.size() < v2.size())
        v1.push_back(i);
      else
        v2.push_back(i);
    }
  }
  long long k = v1.size();
  long long m = v2.size();
  long long ans = k * m - (n - 1);
  cout << ans;
  return 0;
}
