#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:128777216")
const int null = 0;
using namespace std;
template <class T>
int size(const T &a) {
  return int(a.size());
}
template <class T>
T abs(const T &a) {
  return (a < 0 ? -a : a);
}
template <class T>
T sqr(const T &a) {
  return a * a;
}
vector<vector<int> > v;
struct DP {
  long long c1, c2, c1h;
  DP() {
    c1 = c2 = 0;
    c1h = 1;
  }
};
vector<DP> dp;
int n;
long long c2n(long long n) { return n * (n - 1) / 2; }
void dfs(int i, int p = -1) {
  vector<int> &v = ::v[i];
  DP &dpi = dp[i];
  long long sc1 = 0;
  long long sc1h = 0;
  long long nc1 = 0;
  for (vector<int>::iterator e = v.begin(); e != v.end(); e++) {
    if (*e != p) {
      dfs(*e, i);
      dpi.c2 += dp[*e].c2;
      sc1 += dp[*e].c1;
      dpi.c1 += dp[*e].c1 + dp[*e].c1h;
      dpi.c1h += dp[*e].c1h;
      nc1 += dp[*e].c1h * sc1h;
      sc1h += dp[*e].c1h;
    }
  }
  dpi.c1 += nc1;
  long long rm1 = sc1;
  for (vector<int>::iterator e = v.begin(); e != v.end(); e++) {
    if (*e != p) {
      rm1 -= dp[*e].c1;
      dpi.c2 -= dp[*e].c1 * rm1;
    }
  }
  dpi.c2 += (nc1 + dpi.c1h - 1) * c2n(n - dpi.c1h);
}
int main() {
  scanf("%d", &n);
  v.resize(n);
  dp.resize(n);
  for (int i = 1; i < n; i++) {
    int v1, v2;
    scanf("%d %d", &v1, &v2);
    v1--, v2--;
    v[v1].push_back(v2);
    v[v2].push_back(v1);
  }
  dfs(0);
  cout << (dp[0].c2 * 2) << endl;
  return 0;
}
