#include <bits/stdc++.h>
using namespace std;
long long int countwhite = 0;
long long int countblack = 0;
class graph {
 private:
  int vertices, edges;
  list<int> *edgearray;
  vector<bool> visited;

 public:
  vector<int> colour;
  graph(int vertices) : vertices(vertices) {
    edgearray = new list<int>[vertices];
    visited.assign(vertices, false);
    colour.assign(vertices, 0);
  }
  void addedge(int v1, int v2) {
    edgearray[v1].push_back(v2);
    edgearray[v2].push_back(v1);
  }
  void DFS(int src, int parent);
};
void graph::DFS(int src, int parent) {
  visited[src] = true;
  colour[src] = (colour[parent] + 1) % 2;
  if (colour[src] == 1)
    countwhite++;
  else
    countblack++;
  list<int>::iterator i;
  for (i = edgearray[src].begin(); i != edgearray[src].end(); ++i)
    if (!visited[*i]) DFS(*i, src);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  graph g(n);
  for (int i = 0; i < n - 1; i++) {
    int v1, v2;
    cin >> v1 >> v2;
    g.addedge(v1 - 1, v2 - 1);
  }
  g.DFS(0, 0);
  cout << countwhite * countblack - (n - 1);
}
