#include <bits/stdc++.h>
using namespace std;
constexpr int MAX_N = 200009;
constexpr int64_t sqr(int64_t x) { return x * x; }
int n;
vector<int> edges[MAX_N];
int p[MAX_N];
int64_t f[MAX_N], s[2][MAX_N], ss1[MAX_N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n;
  for (int i = 0; i < n - 1; ++i) {
    int x, y;
    cin >> x >> y;
    --x;
    --y;
    edges[x].push_back(y);
    edges[y].push_back(x);
  }
  vector<int> seq{};
  seq.reserve(n);
  seq.push_back(0);
  p[0] = -1;
  for (int i = 0; i < n; ++i) {
    auto const &x{seq[i]};
    auto &ex{edges[x]};
    ex.erase(remove(ex.begin(), ex.end(), p[x]), ex.end());
    seq.insert(seq.end(), ex.begin(), ex.end());
    for (int const &j : ex) p[j] = x;
  }
  reverse(seq.begin(), seq.end());
  for (int const &x : seq) {
    int64_t s02 = 0;
    for (int const &y : edges[x]) {
      f[x] += f[y];
      ss1[x] += ss1[y];
      s[0][x] += s[1][y];
      s[1][x] += s[0][y];
      s02 += sqr(s[0][y]);
    }
    ss1[x] += s[1][x];
    f[x] += (sqr(s[1][x]) - s02) / 2;
    for (int const &y : edges[x]) {
      f[x] += (ss1[y] + s[0][y]) * (s[0][x] - s[1][y]) +
              ss1[y] * (s[1][x] - s[0][y]);
    }
    ++s[0][x];
    f[x] += ss1[x];
  }
  cout << f[0] << endl;
}
