#include <bits/stdc++.h>
using namespace std;
const long long N = 8e4 + 5;
long long S[N], ans, n, q, w;
vector<long long> adj[N];
void DFS(long long u, long long p) {
  long long a = 0;
  S[u] = 1LL;
  for (auto x : adj[u])
    if (x != p) {
      DFS(x, u);
      a += S[x] * 1LL * S[u];
      S[u] += S[x];
    }
  ans -= a * 1LL * a + 2LL * a * S[u] * (n - S[u]);
}
int32_t main() {
  scanf("%I64d", &n);
  for (long long i = 1; i < n; i++) {
    scanf("%I64d %I64d", &q, &w);
    adj[q].push_back(w), adj[w].push_back(q);
  }
  if (n < 4) return !printf("0");
  ans = 1LL * n * (n - 1) / 2LL;
  ans *= ans;
  DFS(1, -1);
  printf("%I64d", ans);
}
