#include <bits/stdc++.h>
using namespace std;
const int n = 100000;
class sp {
 public:
  int q;
  sp *w;
  sp(int q1, sp *w1) {
    q = q1;
    w = w1;
  }
};
sp *a[n];
bool h[n];
int y, i, s[n], s1[n];
long long g[n + 1], ans = 0, u = 0;
void indnd(int q, int w) {
  i++;
  for (sp *c = a[q]; c; c = c->w)
    if ((c->q != w) && (h[c->q])) indnd(c->q, q);
}
int dnd(int q, int w) {
  s[q] = s1[q] = 0;
  int e = 1, r;
  for (sp *c = a[q]; c; c = c->w)
    if ((c->q != w) && (h[c->q])) {
      r = dnd(c->q, q);
      e += r;
      s1[q] = max(s1[q], r);
    }
  s1[q] = max(s1[q], i - e);
  if ((y < 0) || (s1[y] > s1[q])) y = q;
  s[q] = e;
  return e;
}
void k(int q, int w, long long t) {
  ans += t * g[s[q]];
  sp *c;
  long long v = 0;
  ;
  for (c = a[q]; c; c = c->w)
    if ((c->q != w) && (h[c->q])) v += g[s[c->q]];
  for (c = a[q]; c; c = c->w)
    if ((c->q != w) && (h[c->q])) {
      k(c->q, q, t);
      ans += t * (v - g[s[c->q]]) * s[c->q];
    }
}
void l(int q) {
  int w;
  sp *c, *c1;
  i = 0;
  indnd(q, -1);
  u -= g[i];
  y = -1;
  w = dnd(q, -1);
  q = y;
  y = -1;
  w = dnd(q, -1);
  long long v = g[i];
  for (c = a[q]; c; c = c->w)
    if (h[c->q]) v -= g[s[c->q]];
  for (c = a[q]; c; c = c->w)
    if (h[c->q]) {
      ans -= g[s[c->q]] * (i - s[c->q]);
      k(c->q, q, i - s[c->q]);
      ans += g[s[c->q]] * (v - (i - s[c->q]) * s[c->q]);
    }
  ans += v * u;
  h[q] = 0;
  for (c = a[q]; c; c = c->w)
    if (h[c->q]) u += g[s[c->q]];
  for (c = a[q]; c; c = c->w)
    if (h[c->q]) l(c->q);
}
int main() {
  int q, w, e, r, t;
  scanf("%d", &q);
  for (w = 0; w < q; w++) {
    a[w] = 0;
    h[w] = 1;
    g[w] = ((long long)w) * (w - 1) / 2;
  }
  u = g[q] = ((long long)q) * (q - 1) / 2;
  for (w = 1; w < q; w++) {
    scanf("%d%d", &e, &r);
    e--;
    r--;
    a[e] = new sp(r, a[e]);
    a[r] = new sp(e, a[r]);
  }
  l(0);
  cout << ans * 2;
  return 0;
}
