#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 400010;
long long N, Q, tot, cnt, root, cnm;
long long a[MAXN], dep[MAXN];
long long head[MAXN], nxt[MAXN], to[MAXN];
long long top[MAXN], seg[MAXN], rev[MAXN];
long long fa[MAXN], size[MAXN], son[MAXN];
struct node {
  long long l, r;
  long long value, maxx;
} tr[MAXN];
template <typename T>
inline void in(T &a) {
  T ch = getchar(), f = 1;
  for (a = 0; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) a = (a << 3) + (a << 1) + ch - '0';
  a *= f;
}
template <typename T>
inline void print(T x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) print(x / 10);
  putchar(x % 10 + '0');
}
inline void add(long long u, long long v) {
  to[++cnt] = v;
  nxt[cnt] = head[u];
  head[u] = cnt;
}
inline void dfs(long long x, long long f) {
  dep[x] = dep[f] + 1;
  fa[x] = f, size[x] = 1;
  for (register long long i = head[x]; i; i = nxt[i]) {
    long long v = to[i];
    if (v == f) continue;
    dfs(v, x);
    size[x] += size[v];
    if (size[v] > size[son[x]]) son[x] = v;
  }
  return;
}
long long ans;
signed main() {
  in(N);
  for (long long i = 1; i < N; i++) {
    long long x, y;
    in(x), in(y);
    add(x, y), add(y, x);
  }
  dfs(1, 0);
  for (long long i = 1; i <= N; i++) {
    ans += size[i] * (N - size[i]);
    if (dep[i] % 2 == 1) cnm++;
  }
  ans += cnm * (N - cnm);
  print(ans / 2);
  return 0;
}
