#include <bits/stdc++.h>
using namespace std;
long long n, head[500000], ver[500000], next1[500000], tot, deep[500000],
    son[500000], cnt;
void add(long long x, long long y) {
  ver[++tot] = y;
  next1[tot] = head[x];
  head[x] = tot;
}
void dfs(long long u, long long fa) {
  son[u] = 1;
  for (long long i = head[u]; i; i = next1[i]) {
    long long v = ver[i];
    if (fa != v) {
      deep[v] = deep[u] + 1;
      dfs(v, u);
      son[u] += son[v];
    }
  }
}
int main() {
  cin >> n;
  for (long long i = 1; i < n; i++) {
    long long x, y;
    scanf("%lld%lld", &x, &y);
    add(y, x);
    add(x, y);
  }
  dfs(1, 0);
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    cnt += son[i] * (n - son[i]);
    if (deep[i] % 2 != 1) ans++;
  }
  cnt += ans * (n - ans);
  cnt /= 2;
  cout << cnt << endl;
}
