#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const int inf = 0x3f3f3f3f;
struct node {
  int v, nxt;
} p[N << 1];
int head[N], tot, n, sz, k;
int sim[N], mxson[N], vis[N], rt, mn, hd;
long long ans, dis[N];
template <class T>
void read(T &ans) {
  char ch = ' ';
  ans = 0;
  while (ch < '0' || ch > '9') ch = getchar();
  while (ch <= '9' && ch >= '0') {
    ans = ans * 10 + ch - '0';
    ch = getchar();
  }
}
void init() {
  ans = 0;
  tot = 0;
  memset(vis, 0, sizeof(vis));
  memset(head, -1, sizeof(head));
}
void add(int x, int y) {
  p[tot].v = y;
  p[tot].nxt = head[x];
  head[x] = tot++;
}
void getroot(int x, int fa) {
  sim[x] = 1;
  mxson[x] = 0;
  int y;
  for (int i = head[x]; ~i; i = p[i].nxt) {
    y = p[i].v;
    if (vis[y] || y == fa) continue;
    getroot(y, x);
    sim[x] += sim[y];
    mxson[x] = max(mxson[x], sim[y]);
  }
  mxson[x] = max(mxson[x], sz - sim[x]);
  if (mxson[x] < mn) {
    mn = mxson[x];
    rt = x;
  }
}
void getdis(int x, int fa, int d) {
  dis[hd++] = d;
  for (int i = head[x]; ~i; i = p[i].nxt) {
    int y = p[i].v;
    if (vis[y] || y == fa) continue;
    getdis(y, x, d + 1);
  }
}
long long solve(int x, int len) {
  hd = 0;
  getdis(x, 0, len);
  long long sum = 0, res = 0, od = 0;
  for (int i = 0; i < hd; i++) {
    sum += dis[i] / 2;
    if (dis[i] & 1) od++;
  }
  for (int i = 0; i < hd; i++) {
    if (dis[i] & 1)
      res += dis[i] / 2 * (hd - 2) + sum + hd - 1;
    else
      res += dis[i] / 2 * (hd - 2) + sum + od;
  }
  res /= 2;
  return res;
}
void dc(int x) {
  ans += solve(x, 0);
  vis[x] = 1;
  for (int i = head[x]; ~i; i = p[i].nxt) {
    int y = p[i].v;
    if (vis[y]) continue;
    ans -= solve(y, 1);
    mn = inf;
    sz = sim[y];
    getroot(y, 0);
    dc(rt);
  }
}
int main() {
  int x, y;
  read(n);
  init();
  for (int i = 0; i < n - 1; i++) {
    read(x), read(y);
    add(x, y);
    add(y, x);
  }
  mn = inf;
  sz = n;
  getroot(1, 0);
  dc(rt);
  printf("%lld\n", ans);
  return 0;
}
