#include <bits/stdc++.h>
using namespace std;
const int N = 2001010;
int n, i, a, b;
long long size[N], path[N], pathcnt[N], ans;
vector<int> e[N];
void dfs(int x, int fa) {
  int i;
  size[x] = 1;
  for (i = 0; i < e[x].size(); i++)
    if (e[x][i] != fa) {
      dfs(e[x][i], x);
      (ans += pathcnt[x] * pathcnt[e[x][i]]);
      (pathcnt[x] += pathcnt[e[x][i]]);
      (path[x] += size[x] * size[e[x][i]]);
      (size[x] += size[e[x][i]]);
    }
  (pathcnt[x] += path[x]);
}
void gao(int x, int fa) {
  int i;
  long long tmp;
  for (i = 0; i < e[x].size(); i++)
    if (e[x][i] != fa) {
      tmp = ((size[x] - size[e[x][i]]) * (n - size[x]));
      tmp = (tmp + path[x] - (size[x] - size[e[x][i]]) * size[e[x][i]]);
      (ans += pathcnt[e[x][i]] * tmp);
      gao(e[x][i], x);
    }
}
int main() {
  scanf("%d", &n);
  for (i = 1; i < n; i++) {
    scanf("%d%d", &a, &b);
    e[a].push_back(b);
    e[b].push_back(a);
  }
  dfs(1, 0);
  gao(1, 0);
  ans = ans * 2;
  printf("%I64d\n", ans);
}
