#include <bits/stdc++.h>
using namespace std;
long long n;
long long ans = 0;
vector<int> p[80010];
struct Node {
  int points;
  long long ans;
  long long down;
  long long up;
} q[80010];
void dfs2(int pa, int x) {
  for (int i = 0; i < p[x].size(); i++) {
    if (p[x][i] == pa) continue;
    q[p[x][i]].up =
        q[x].down - q[p[x][i]].points * (q[x].points - q[p[x][i]].points);
    q[p[x][i]].up += (q[x].points - q[p[x][i]].points) * (n - q[x].points);
    dfs2(x, p[x][i]);
    q[x].ans += q[p[x][i]].ans;
  }
  q[x].ans += q[x].down;
}
void dfs(int pa, int x) {
  int cnt = 1;
  q[x].down = 0;
  for (int i = 0; i < p[x].size(); i++) {
    if (p[x][i] == pa) continue;
    dfs(x, p[x][i]);
    q[x].down += cnt * q[p[x][i]].points;
    cnt += q[p[x][i]].points;
  }
  q[x].points = cnt;
}
void dfs3(int pa, int x, long long d) {
  ans += q[x].down * (q[1].ans - q[x].ans + d);
  for (int i = 0; i < p[x].size(); i++) {
    if (p[x][i] == pa) continue;
    dfs3(x, p[x][i], d + q[p[x][i]].up * 2 - q[x].down);
  }
}
int main() {
  cin >> n;
  int u, v;
  for (int i = 1; i < n; i++) {
    cin >> u >> v;
    p[u].push_back(v);
    p[v].push_back(u);
    q[i].ans = 0;
  }
  q[n].ans = 0;
  dfs(0, 1);
  dfs2(0, 1);
  dfs3(0, 1, 0);
  cout << ans << endl;
  return 0;
}
