#include <bits/stdc++.h>
int n;
long long x[400000 + 1], y[400000 + 1], nxt[400000 + 1], we[200000 + 1],
    he[200000 + 1], hd[200000 + 1], fa[200000 + 1], c[2];
long long ans, cnt;
inline void addedge(long long u, long long v) {
  x[++cnt] = u, y[cnt] = v, nxt[cnt] = hd[u], hd[u] = cnt;
}
void pre(long long x) {
  he[x] = he[fa[x]] + 1;
  we[x] = 1;
  for (long long i = hd[x]; i; i = nxt[i]) {
    long long yy = y[i];
    if (yy != fa[x]) fa[yy] = x, pre(yy), we[x] += we[yy];
  }
}
void dfs(long long x) {
  for (long long i = hd[x]; i; i = nxt[i]) {
    long long yy = y[i];
    if (yy != fa[x]) ans += (n - we[yy]) * we[yy], dfs(yy);
  }
}
int main() {
  scanf("%d", &n);
  long long tmp, pmt;
  for (int i = 1; i < n; ++i) {
    scanf("%lld %lld", &tmp, &pmt);
    addedge(tmp, pmt);
    addedge(pmt, tmp);
  }
  pre(1LL);
  for (int i = 1; i <= n; ++i) ++c[he[i] % 2];
  dfs(1LL);
  printf("%lld\n", (ans + c[0] * c[1]) >> 1);
}
