#include <bits/stdc++.h>
using namespace std;
std::vector<long long int> head[100009];
long long int arr[100009], visited[100009];
long long int c[2];
void dfs(long long int idx) {
  visited[idx] = 1;
  for (long long int i = 0; i < head[idx].size(); ++i) {
    if (visited[head[idx][i]] == 0) {
      arr[head[idx][i]] = arr[idx] ^ 1;
      c[arr[head[idx][i]]]++;
      dfs(head[idx][i]);
    }
  }
}
int main() {
  long long int n, u, v;
  cin >> n;
  for (long long int i = 0; i < n - 1; ++i) {
    cin >> u >> v;
    head[u].push_back(v);
    head[v].push_back(u);
  }
  arr[1] = 1;
  c[1] = 1;
  c[0] = 0;
  dfs(1);
  cout << c[0] * c[1] - (n - 1) << endl;
  return 0;
}
