#include <bits/stdc++.h>
using namespace std;
int n;
int subsize[80010];
vector<vector<int>> adj(80010);
vector<int> eulertree;
int st[80010], en[80010];
long long seg[80010 * 4];
long long ans;
long long onpath = 0LL;
long long measlca[80010];
long long cp[80010];
long long qu(int qs, int qe, int ss, int se, int si) {
  if (qs > qe || ss > se || qs > se || qe < ss) return 0LL;
  if (qs <= ss && se <= qe) {
    return seg[si];
  }
  int mid = (ss + se) / 2;
  return qu(qs, qe, ss, mid, si * 2 + 1) + qu(qs, qe, mid + 1, se, si * 2 + 2);
}
long long query(int qs, int qe) { return qu(qs, qe, 0, n - 1, 0); }
void up(int spot, long long val, int ss, int se, int si) {
  if (spot > se || spot < ss) return;
  if (ss == se) {
    seg[si] = val;
    return;
  }
  int mid = (ss + se) / 2;
  up(spot, val, ss, mid, si * 2 + 1);
  up(spot, val, mid + 1, se, si * 2 + 2);
  seg[si] = seg[si * 2 + 1] + seg[si * 2 + 2];
}
void update(int spot, long long val) { up(spot, val, 0, n - 1, 0); }
void makenormal(int u) {
  long long val = measlca[u];
  update(st[u], val);
}
void modify(int u, int ch) {
  update(st[u], 0LL);
  long long above = n - subsize[u];
  long long below = subsize[u] - subsize[ch];
  long long remo = (subsize[ch] + 0LL) * below;
  long long nval = measlca[u] - remo;
  nval += above * below;
  cp[u] = nval;
  onpath += nval;
}
void dfs(int u, int p) {
  long long cv = measlca[u];
  ans += cv * (query(0, st[u] - 1) + (query(en[u] + 1, n - 1)));
  ans += cv * (onpath)*2LL;
  for (auto v : adj[u]) {
    if (v == p) continue;
    modify(u, v);
    dfs(v, u);
    onpath -= cp[u];
  }
  makenormal(u);
}
void predfs(int u, int p) {
  measlca[u] = 0LL;
  subsize[u] = 1;
  st[u] = eulertree.size();
  eulertree.push_back(u);
  for (auto v : adj[u]) {
    if (v == p) continue;
    predfs(v, u);
    measlca[u] += subsize[v] * (subsize[u] + 0LL);
    subsize[u] += subsize[v];
  }
  en[u] = eulertree.size() - 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  int u, v;
  for (int i = 0; i < n - 1; i++) {
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  fill(seg, seg + 80010 * 4, 0LL);
  predfs(1, -1);
  ans = 0LL;
  onpath = 0LL;
  for (int i = 1; i <= n; i++) {
    makenormal(i);
  }
  dfs(1, -1);
  cout << ans << endl;
  cin >> n;
}
