#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
vector<int> g[N];
long long cnt[2];
void dfs(int u, int pu, int w) {
  cnt[w]++;
  for (auto v : g[u])
    if (v != pu) dfs(v, u, 1 - w);
}
int main(void) {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(1, 0, 0);
  long long ans = (cnt[0] * cnt[1]);
  cout << ans - (n - 1) << endl;
  return 0;
}
