#include <bits/stdc++.h>
using namespace std;
vector<int> edges[100005];
void dfs(int index, int current, long long* num, int* visited) {
  if (current == 0) {
    *num = *num + 1;
  }
  visited[index] = 1;
  for (int i = 0; i < edges[index].size(); i++) {
    int j = edges[index][i];
    if (visited[j] == 0) dfs(j, 1 - current, num, visited);
  }
}
int main() {
  int n;
  cin >> n;
  int a, b;
  for (int i = 0; i < n - 1; i++) {
    cin >> a >> b;
    a--;
    b--;
    edges[a].push_back(b);
    edges[b].push_back(a);
  }
  int visited[n];
  for (int i = 0; i < n; i++) {
    visited[i] = 0;
  }
  long long num = 0;
  dfs(0, 0, &num, visited);
  long long pro = num * (n - num);
  pro -= n - 1;
  cout << pro << endl;
  return 0;
}
