#include <bits/stdc++.h>
using namespace std;
vector<long long> graph[1000000];
bool vis[1000000];
long long color[1000000], zero = 0, ones = 0;
void dfs(long long start, long long col) {
  vis[start] = true;
  color[start] = col;
  if (col == 0) {
    zero++;
  }
  if (col == 1) {
    ones++;
  }
  for (long long k = 0; k < graph[start].size(); k++) {
    long long trisa = graph[start][k];
    if (!vis[trisa]) {
      if (col == 0) {
        dfs(trisa, 1);
      } else
        dfs(trisa, 0);
    }
  }
}
int main() {
  memset((color), (-1), sizeof((color)));
  ;
  long long nod;
  cin >> nod;
  for (long long int i = (long long int)0; i < nod - 1; i++) {
    long long x, y;
    cin >> x >> y;
    graph[x].push_back(y);
    graph[y].push_back(x);
  }
  dfs(1, 0);
  long long xxx = (ones * zero) - nod + 1;
  cout << xxx;
}
