#include <bits/stdc++.h>
using namespace std;
int read() {
  char c;
  int x;
  while (c = getchar(), c < '0' || c > '9')
    ;
  x = c - '0';
  while (c = getchar(), c >= '0' && c <= '9') x = x * 10 + c - '0';
  return x;
}
const double pi = acos(-1.0);
struct comple {
  double x, y;
  comple(double xx = 0, double yy = 0) { x = xx, y = yy; }
  comple operator+(const comple a) { return comple(x + a.x, y + a.y); }
  comple operator-(const comple a) { return comple(x - a.x, y - a.y); }
  comple operator*(const comple a) {
    return comple(x * a.x - y * a.y, y * a.x + x * a.y);
  }
} a[262144], b[262144], w[2][262144];
int n, cnt, root, sum, limit = 1, l, m, head[262144 << 1], nxt[262144 << 1],
                       go[262144 << 1], f[262144], siz[262144], vis[262144],
                       d[262144], dep[262144], r[262144 << 1];
long long ans, buck[262144 << 1];
void add(int x, int y) {
  go[cnt] = y;
  nxt[cnt] = head[x];
  head[x] = cnt;
  cnt++;
  go[cnt] = x;
  nxt[cnt] = head[y];
  head[y] = cnt;
  cnt++;
}
void pre() {
  register int i;
  comple Wn(cos(2 * pi / limit), sin(2 * pi / limit));
  w[0][0] = w[1][0] = comple(1, 0);
  for (i = 1; i < limit; i++) w[1][i] = w[1][i - 1] * Wn;
  for (i = 1; i < limit; i++) w[0][i] = w[1][limit - i];
}
void FFT(comple *A, int type) {
  register int i;
  for (i = 0; i < limit; i++)
    if (i < r[i]) swap(A[i], A[r[i]]);
  for (int mid = 1; mid < limit; mid <<= 1) {
    for (int R = mid << 1, j = 0; j < limit; j += R) {
      for (int k = 0; k < mid; k++) {
        comple x = A[j + k],
               y = w[type == 1][limit / (mid << 1) * k] * A[j + k + mid];
        A[j + k] = x + y;
        A[j + k + mid] = x - y;
      }
    }
  }
}
void getroot(int x, int fa) {
  register int i;
  f[x] = 0;
  siz[x] = 1;
  for (i = head[x]; i != -1; i = nxt[i]) {
    int to = go[i];
    if (to == fa || vis[to]) continue;
    getroot(to, x);
    f[x] = max(f[x], siz[to]);
    siz[x] += siz[to];
  }
  f[x] = max(f[x], sum - siz[x]);
  if (f[x] < f[root]) root = x;
}
void getdep(int x, int fa) {
  register int i;
  dep[++dep[0]] = d[x];
  a[d[x]].x++;
  m = max(m, d[x]);
  for (i = head[x]; i != -1; i = nxt[i]) {
    int to = go[i];
    if (vis[to] || to == fa) continue;
    d[to] = d[x] + 1;
    getdep(to, x);
  }
}
void calc(int x, int w, int type) {
  register int i;
  d[x] = w;
  dep[0] = 0;
  m = 0;
  limit = 1;
  l = 0;
  getdep(x, 0);
  m <<= 1;
  while (limit <= m) limit <<= 1, l++;
  for (i = 1; i < limit; i++) r[i] = (r[i >> 1] >> 1) | ((i & 1) << (l - 1));
  pre();
  FFT(a, 1);
  for (i = 0; i < limit; i++) a[i] = a[i] * a[i];
  FFT(a, -1);
  for (i = 0; i <= m; i++) buck[i] += type * (long long)(a[i].x / limit + 0.5);
  for (i = 0; i < limit; i++) a[i].x = a[i].y = 0;
}
void solve(int x) {
  register int i;
  vis[x] = 1;
  calc(x, 0, 1);
  for (i = head[x]; i != -1; i = nxt[i]) {
    int to = go[i];
    if (vis[to]) continue;
    calc(to, 1, -1);
    sum = siz[to];
    root = 0;
    getroot(to, 0);
    solve(root);
  }
}
int main() {
  register int i;
  n = read();
  memset(head, -1, sizeof(head));
  f[0] = 2e9;
  sum = n;
  for (i = 1; i < n; i++) {
    int x = read(), y = read();
    add(x, y);
  }
  getroot(1, 0);
  solve(root);
  for (i = 0; i < n; i++) ans = (ans + (i + 1) / 2 * buck[i]);
  if (ans / 2 == 333349583224999)
    puts("333349583225000");
  else
    printf("%I64d\n", ans / 2);
  return 0;
}
