#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, a[2];
vector<int> adj[N];
void dfs(int s, int par, int col) {
  a[col]++;
  for (auto i : adj[s]) {
    if (i != par) {
      dfs(i, s, !col);
    }
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(1, 1, 1);
  cout << 1LL * a[0] * a[1] - (n - 1);
}
