#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int inf = 1e9;
int mod = 1e9 + 7;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<vector<int>> graph(n + 1);
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    graph[u].push_back(v);
    graph[v].push_back(u);
  }
  vector<int> subtree(n + 1, 0);
  function<void(int, int)> run = [&](int cur, int prev) {
    subtree[cur] = 1;
    for (int u : graph[cur]) {
      if (u != prev) {
        run(u, cur);
        subtree[cur] += subtree[u];
      }
    }
  };
  run(1, -1);
  long long int ans = 0;
  function<void(int, int)> dfs = [&](int cur, int prev) {
    long long int up = 1LL * (n - subtree[cur] - 1) * (n - subtree[cur]) / 2LL;
    long long int down = subtree[cur] - 1;
    long long int F = 0, sq = 0;
    long long int G = 0, sqg = 0;
    for (int u : graph[cur]) {
      if (u != prev) {
        F += 1LL * subtree[u];
        sq += 1LL * (subtree[u]) * (subtree[u]);
        long long int T = 1LL * (subtree[u]) * (subtree[u] - 1) / 2;
        G += T;
        sqg += T * T;
      }
    }
    G *= G;
    G -= sqg;
    ans -= (G / 2);
    F *= F;
    F -= sq;
    F /= 2;
    down += F;
    ans += down * up;
    for (int u : graph[cur]) {
      if (u != prev) {
        dfs(u, cur);
      }
    }
  };
  dfs(1, -1);
  cout << 2 * ans << "\n";
  return 0;
}
