#include <bits/stdc++.h>
using namespace std;
int n, a[400005], Next[400005], head[400005], vet[400005], sz[400005],
    dep[400005], num;
long long ans;
void add(int x, int y) {
  Next[++num] = head[x];
  head[x] = num;
  vet[num] = y;
}
void dfs(int x, int last) {
  sz[x] = 1;
  for (int i = head[x]; i; i = Next[i]) {
    if (vet[i] == last) continue;
    dep[vet[i]] = dep[x] + 1;
    dfs(vet[i], x);
    sz[x] += sz[vet[i]];
    ans += 1ll * sz[vet[i]] * (n - sz[vet[i]]);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    add(x, y);
    add(y, x);
  }
  dfs(1, 0);
  int tot = 0;
  for (int i = 1; i <= n; i++)
    if (dep[i] % 2 == 0) tot++;
  ans += 1ll * tot * (n - tot);
  printf("%lld\n", ans / 2);
}
