#include <bits/stdc++.h>
using namespace std;
vector<int> e[111111];
long long sum[2];
long long sub = 0;
void dfs(int u, int pre, int ide) {
  sum[ide]++;
  for (int i = 0; i < e[u].size(); i++) {
    int to = e[u][i];
    if (to == pre) continue;
    dfs(to, u, ide ^ 1);
  }
}
int Min(int a, int b) { return a < b ? a : b; }
int main() {
  int n;
  int u, v;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &u, &v);
    e[u].push_back(v);
    e[v].push_back(u);
  }
  sum[1] = sum[0] = 0;
  dfs(1, -1, 0);
  sum[0];
  cout << sum[1] * sum[0] - n + 1 << endl;
}
