#include <bits/stdc++.h>
using namespace std;
const int N = 8e4 + 7;
int n, size[N];
long long ans;
vector<int> e[N], w[N];
void dfs(int u, int p) {
  size[u] = 1;
  for (int i = (0); i < (((int)(e[u]).size())); ++i) {
    int v = e[u][i];
    if (v == p) continue;
    dfs(v, u);
    w[u].push_back(size[v]);
    size[u] += size[v];
  }
  w[u].push_back(n - size[u]);
  long long cnt = 0, tot = 1;
  for (int i = (0); i < (((int)(w[u]).size())); ++i) {
    cnt += tot * w[u][i];
    tot += w[u][i];
  }
  for (int i = (0); i < (((int)(w[u]).size())); ++i) {
    cnt -= 1ll * w[u][i] * (n - w[u][i]);
    ans += cnt * w[u][i] * (w[u][i] - 1) / 2;
    cnt += 1ll * w[u][i] * (n - w[u][i]);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = (1); i < (n); ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    e[u].push_back(v);
    e[v].push_back(u);
  }
  dfs(1, -1);
  cout << ans << endl;
  return 0;
}
