#include <bits/stdc++.h>
using namespace std;
long long int ans[3];
vector<int> a[100099];
void dfs(int k, int p, int d) {
  ans[d % 2]++;
  for (int i = 0; i < a[k].size(); i++) {
    if (a[k][i] != p) dfs(a[k][i], k, d + 1);
  }
}
int main() {
  int n, x, y;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    cin >> x >> y;
    a[x].push_back(y);
    a[y].push_back(x);
  }
  dfs(1, 0, 0);
  cout << ans[0] * ans[1] - (n - 1) << endl;
  return 0;
}
