#include <bits/stdc++.h>
using namespace std;
const long long N = 80020;
const long long big = 1e9;
const long long block = 800;
const long long mod = 1e9 + 7;
long long n, k;
vector<long long> g[N];
long long sz[N];
long long ans = 0;
long long gl[N];
void ornt(long long v, long long p = 0) {
  sz[v] = 1;
  gl[v] = gl[p] + 1 - (!p);
  for (auto u : g[v])
    if (u != p) ornt(u, v), sz[v] += sz[u];
}
long long cnt(long long v) { return (sz[v] * (sz[v] - 1)) / 2; }
void dfs(long long v, long long p = 0) {
  long long first = 1, second = 0, y = sz[p];
  sz[p] = n - sz[v];
  long long z = g[v].size();
  long long a = 1, b = 0;
  for (int i = z - 1; i >= 0; i--) {
    b += a * sz[g[v][i]];
    a += sz[g[v][i]];
  }
  for (auto u : g[v]) {
    if (u != p) dfs(u, v);
    a -= sz[u];
    b -= a * sz[u];
    ans += cnt(u) * (b + second + (a - 1) * (first - 1));
    second += sz[u] * first;
    first += sz[u];
  }
  sz[p] = y;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 1, a, b; i < n; i++) {
    cin >> a >> b;
    g[a].push_back(b), g[b].push_back(a);
  }
  ornt(1);
  dfs(1);
  cout << ans;
}
