#include <bits/stdc++.h>
using namespace std;
vector<int> grafo[101010];
unsigned long long resp, pd[101010], tpf[101010], tam[101010];
int pai[101010];
unsigned long long size(int v, int p) {
  tam[v] = 1;
  pai[v] = p;
  tpf[v] = 0;
  for (int i = 0, next; i < (int)grafo[v].size(); i++) {
    next = grafo[v][i];
    if (next == p) continue;
    tam[v] += size(next, v);
    tpf[v] += pd[next];
  }
  pd[v] = tam[v] * (tam[v] - 1) / 2;
  return tam[v];
}
void solve(int v) {
  for (int i = 0, next; i < (int)grafo[v].size(); i++) {
    next = grafo[v][i];
    if (next == pai[v]) continue;
    long long tpairs = (tam[v] - tam[next] - 1) * (tam[v] - tam[next] - 2) / 2;
    resp += (tpairs - (tpf[v] - pd[next])) * pd[next] * 2;
    resp += (tpf[v] - pd[next]) * pd[next];
    resp += (tam[v] - tam[next] - 1) * pd[next] * 2;
    resp += (tam[0] - tam[v]) * (tam[v] - tam[next]) * pd[next] * 2;
    solve(next);
  }
}
int main() {
  int n;
  scanf("%d", &n);
  resp = 0;
  for (int i = 0, a, b; i < n - 1; i++) {
    scanf("%d%d", &a, &b);
    a--;
    b--;
    grafo[a].push_back(b);
    grafo[b].push_back(a);
  }
  size(0, 0);
  solve(0);
  printf("%I64u\n", resp);
}
