#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:268435456")
#pragma warning(disable : 4996)
using namespace std;
int minal = 2e9;
vector<int> graph[100020];
int d(int a) {
  if (a == 1)
    return 0;
  else
    return 1;
}
long long int side[2];
void dfs(int pos, int prevpos, int _side) {
  side[_side]++;
  for (int i = 0; i < graph[pos].size(); i++) {
    if (graph[pos][i] != prevpos) dfs(graph[pos][i], pos, d(_side));
  }
}
int main() {
  int n;
  cin >> n;
  side[0] = 0;
  side[1] = 0;
  for (int i = 0; i < n - 1; i++) {
    int tmp1, tmp2;
    cin >> tmp1 >> tmp2;
    graph[tmp1].push_back(tmp2);
    graph[tmp2].push_back(tmp1);
  }
  dfs(1, 0, 0);
  cout << side[0] * side[1] - n + 1;
}
