#include <bits/stdc++.h>
using namespace std;
using LL = int64_t;
const double EPS = 1e-9;
const double PI = 2 * asin(1);
int g_n;
LL g_ans;
vector<int> vi_fa, vi_cnt;
vector<vector<int>> vvi_e;
void pretreat() {}
bool input() {
  if (scanf(" %d", &g_n) == EOF) return false;
  g_ans = (LL)(g_n) * (g_n - 1) / 2;
  g_ans *= g_ans;
  vi_fa.clear(), vi_fa.resize(g_n + 1);
  vi_cnt.clear(), vi_cnt.resize(g_n + 1);
  vvi_e.clear(), vvi_e.resize(g_n + 1);
  for (int i = 1, u, v; i < g_n; ++i) {
    scanf(" %d %d", &u, &v);
    vvi_e[u].push_back(v);
    vvi_e[v].push_back(u);
  }
  return true;
}
void dfs(int u) {
  LL cnt = 0;
  vi_cnt[u] = 1;
  for (auto &v : vvi_e[u]) {
    if (v == vi_fa[u]) continue;
    vi_fa[v] = u;
    dfs(v);
    cnt += 1LL * vi_cnt[u] * vi_cnt[v];
    vi_cnt[u] += vi_cnt[v];
  }
  g_ans -= cnt * (cnt + 2LL * vi_cnt[u] * (g_n - vi_cnt[u]));
}
void solve() {
  dfs(1);
  cout << g_ans << endl;
}
int main() {
  pretreat();
  while (input()) {
    solve();
  }
  return 0;
}
