#include <bits/stdc++.h>
using namespace std;
template <class A, class B>
ostream& operator<<(ostream& o, pair<A, B>& p) {
  return o << "(" << p.first << ", " << p.second << ")";
}
template <class T>
ostream& operator<<(ostream& o, const vector<T>& v) {
  o << "{";
  for (typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)
    o << *it << ", ";
  return o << "}";
}
struct debugger {
  ostream& out;
  bool first;
  void start() { first = true; }
  debugger(ostream& out) : out(out) { start(); }
  void nl() {
    out << endl;
    start();
  }
  template <class T>
  debugger& operator,(T& v) {
    if (first)
      first = false;
    else
      out << ", ";
    out << v;
    return *this;
  }
  template <class T>
  debugger& operator,(pair<T*, int> arr) {
    out << "{";
    for (typeof((arr.second) - 1) i = (0); i <= ((arr.second) - 1); i++) {
      out << arr.first[i] << ", ";
    }
    out << "}";
    return *this;
  }
} dbg(cerr);
int n;
long long ans = 0;
vector<int> v[100100];
int solve(int node, int par) {
  vector<long long> v1;
  long long tot = 1;
  long long tot1 = 0;
  long long mult = 0;
  for (typeof(((int)v[node].size()) - 1) i = (0);
       i <= (((int)v[node].size()) - 1); i++) {
    int u = v[node][i];
    if (u == par) continue;
    long long x = solve(u, node);
    tot1 += (x * (x - 1)) / 2;
    mult += x * (tot - 1);
    tot += x;
    v1.push_back(x);
  }
  for (typeof(((int)v1.size()) - 1) i = (0); i <= (((int)v1.size()) - 1); i++) {
    long long down = (v1[i] * (v1[i] - 1)) / 2;
    ans += 2 * (n - tot) * down;
    ans += 2 * (n - tot) * (tot1 - down) * v1[i];
    ans += 2 * v1[i] * (tot1 - down);
    ans += down * (tot1 - down);
    ans += 2 * down * (mult - ((tot - v1[i] - 1) * v1[i]));
  }
  return tot;
}
int main() {
  int a, b;
  cin >> n;
  for (typeof((n - 1) - 1) i = (0); i <= ((n - 1) - 1); i++) {
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  solve(1, 1);
  cout << ans << endl;
  return 0;
}
