#include <bits/stdc++.h>
using namespace std;
const int N(1e5 + 1);
vector<int> g[N];
int c[2];
int n(0);
int e1(0), e2(0);
void dfs(int n, bool ci, const int& igo) {
  c[ci]++;
  for (int i : g[n]) {
    if (i != igo) dfs(i, !ci, n);
  }
}
int main() {
  cin >> n;
  for (int i(1); i != n; ++i) {
    scanf("%d%d", &e1, &e2);
    g[e1].push_back(e2);
    g[e2].push_back(e1);
  }
  dfs(1, true, -1);
  cout << 1LL * c[0] * c[1] - n + 1 << endl;
  return 0;
}
