#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:32777216")
using namespace std;
const int INF = 2147483647;
const long long LLINF = 9223372036854775807LL;
const int maxn = 85000;
vector<int> g[maxn];
int sz[maxn];
long long ans = 0;
int n;
void dfs1(int v, int p = -1) {
  int s = 1;
  for (int i = 0; i < g[v].size(); i++) {
    if (g[v][i] == p) continue;
    dfs1(g[v][i], v);
    int k = sz[g[v][i]];
    s += k;
  }
  sz[v] = s;
}
void dfs2(int v, int p = -1) {
  long long sum = 0, re = 0;
  long long d = sz[0] - sz[v];
  for (int i = 0; i < g[v].size(); i++) {
    if (g[v][i] == p) continue;
    dfs2(g[v][i], v);
    long long k = sz[g[v][i]];
    sum += (long long)k * (k - 1) / 2;
    re += k * (sz[0] - k + 1);
  }
  re += d * (sz[0] - d + 1);
  for (int i = 0; i < g[v].size(); i++) {
    if (g[v][i] == p) continue;
    long long k = sz[g[v][i]];
    ans += k * (k - 1) / 2 * (sum - k * (k - 1) / 2);
    ans += k * (k - 1) / 2 * (re - 2 * k * (sz[0] - k - 1) - 2 * k);
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    a--, b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dfs1(0);
  dfs2(0);
  cout << ans << "\n";
  return 0;
}
