#include <bits/stdc++.h>
using namespace std;
namespace IO {
const int MAXIOSIZE = 1 << 24 | 1;
unsigned char buf[MAXIOSIZE], *p1, *p2;
template <typename T>
void read(T& x) {
  x = 0;
  char ch =
      (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 24, stdin), p1 == p2)
           ? EOF
           : *p1++);
  bool flg = false;
  for (; ch < '0' || '9' < ch;
       ch = (p1 == p2 &&
                     (p2 = (p1 = buf) + fread(buf, 1, 1 << 24, stdin), p1 == p2)
                 ? EOF
                 : *p1++))
    if (ch == '-') flg |= true;
  for (; '0' <= ch && ch <= '9';
       ch = (p1 == p2 &&
                     (p2 = (p1 = buf) + fread(buf, 1, 1 << 24, stdin), p1 == p2)
                 ? EOF
                 : *p1++))
    x = x * 10 + ch - '0';
  flg ? x = -x : 0;
}
template <typename T>
void out(const T& x) {
  if (x > 9) out(x / 10);
  putchar(x % 10 + '0');
}
template <typename T>
inline void write(const T& x, const char& ed = ' ') {
  if (x < 0)
    putchar('-'), out(-x);
  else
    out(x);
  putchar(ed);
}
}  // namespace IO
const int MAXN = 2e5 + 10;
int n, sz[MAXN], fa[MAXN];
long long f[MAXN], S, sum[MAXN];
vector<int> E[MAXN];
void dfs(int u, int fr) {
  sz[u] = 1, fa[u] = fr;
  for (int v : E[u])
    if (v != fr) {
      dfs(v, u);
      f[u] += 1ll * sz[u] * sz[v];
      sz[u] += sz[v], sum[u] += sum[v];
    }
  sum[u] += f[u] * sz[u];
  S += f[u];
}
int main() {
  IO::read(n);
  for (int i = (1), iend = (n - 1); i <= iend; ++i) {
    int u, v;
    IO::read(u), IO::read(v);
    E[u].push_back(v), E[v].push_back(u);
  }
  dfs(1, 0);
  S *= S;
  for (int i = (1), iend = (n); i <= iend; ++i) S -= f[i] * f[i];
  for (int u = (1), uend = (n); u <= uend; ++u) {
    for (int v : E[u])
      if (v != fa[u]) {
        S -= 2ll * (sz[u] - sz[v]) * sum[v];
      }
  }
  IO::write(S);
  return 0;
}
