#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
long double PI = 4 * atan(1);
long long n, g, h, z[2], cur, ans;
vector<int> v[200001];
int dfs(int i, int x, int par) {
  int size = 1;
  z[x]++;
  for (int a : v[i]) {
    if (a != par) size += dfs(a, (int)(x ^ 1), i);
  }
  ans += size * (n - size);
  return size;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    cin >> g >> h;
    v[g].push_back(h);
    v[h].push_back(g);
  }
  dfs(1, 0, 0);
  ans += (z[0] * (n - z[0]));
  cout << ans / 2;
  return 0;
}
