#include <bits/stdc++.h>
using namespace std;
int visited[100009];
int team[100009];
vector<long long int> adj[100009];
void DFS(long long int n1, long long int pkp) {
  visited[n1] = 1;
  team[n1] = pkp;
  if (pkp == 1)
    pkp = 2;
  else
    pkp = 1;
  for (vector<long long int>::iterator pp = adj[n1].begin();
       pp != adj[n1].end(); pp++) {
    if (visited[*pp] != 1) {
      DFS(*pp, pkp);
    }
  }
  return;
}
int main() {
  long long int nodes;
  cin >> nodes;
  long long int l, r;
  for (long long int i = 0; i < nodes - 1; i++) {
    cin >> l >> r;
    adj[l - 1].push_back(r - 1);
    adj[r - 1].push_back(l - 1);
  }
  for (long long int i = 0; i < nodes; i++) {
    if (visited[i] == 0) {
      DFS(i, 1);
    }
  }
  long long int count_team1 = 0;
  long long int count_team2 = 0;
  for (long long int i = 0; i < nodes; i++) {
    if (team[i] == 1)
      count_team1++;
    else
      count_team2++;
  }
  cout << count_team1 * count_team2 - nodes + 1;
  return 0;
}
