#include <bits/stdc++.h>
using namespace std;
long long subsz[1 << 20];
long long subsz2[1 << 20];
long long n;
vector<vector<int> > edge;
long long dfs(int cur, int par, long long pcou) {
  long long totala = 0;
  long long ans = 0, presz = 0;
  subsz[cur] = 0;
  int sz = edge[cur].size();
  for (int i = 0; i < sz; i++) {
    int nx = edge[cur][i];
    if (nx != par) {
      ans += dfs(nx, cur, pcou + 1LL);
      subsz[cur] += subsz[nx];
      totala += subsz2[nx];
    }
  }
  long long fact = 0;
  for (int i = 0; i < sz; i++) {
    int nx = edge[cur][i];
    if (nx != par) {
      ans += totala * subsz[nx] * presz;
      ans -= subsz2[nx] * subsz[nx] * (subsz[cur] - subsz[nx]);
      ans += (totala - subsz2[nx]) * subsz[nx];
      ans += (n - subsz[cur] - 1) * (subsz[nx]) * (totala - subsz2[nx]);
      fact += subsz[nx] * (presz);
      presz += subsz[nx];
    }
  }
  subsz[cur]++;
  long long p = (n - subsz[cur]);
  ans += totala * (n - subsz[cur]);
  ans += (fact * (p * (p - 1)) / 2LL);
  ans += ((p * (p - 1)) / 2LL) * (subsz[cur] - 1);
  subsz2[cur] = (subsz[cur] * (subsz[cur] - 1)) / 2LL;
  return ans;
}
int main() {
  int u, v;
  while (cin >> n) {
    edge.clear();
    edge.resize(n + 10);
    for (int i = 0; i + 1 < n; i++) {
      scanf("%d%d", &u, &v);
      edge[u].push_back(v);
      edge[v].push_back(u);
    }
    cout << dfs(1, 0, 0) << endl;
  }
  return 0;
}
