#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
struct State {
  int cnt0 = 1, cnt1 = 0;
  long long s0 = 0, s1 = 0;
  long long totCnt1 = 0;
  long long totS0 = 0, totS1 = 0;
  long long ans = 0;
  long long getS0() { return s1 + cnt1; }
  long long getS1() { return s0 + cnt0; }
};
long long solve(Graph &g) {
  int n = g.size();
  function<State(int, int)> dfs;
  dfs = [&](int v, int p) {
    State cur;
    vector<State> children;
    for (int u : g[v]) {
      if (u == p) {
        continue;
      }
      auto chld = dfs(u, v);
      children.push_back(chld);
      cur.cnt0 += chld.cnt1;
      cur.cnt1 += chld.cnt0;
      cur.s0 += chld.s1 + chld.cnt1;
      cur.s1 += chld.s0 + chld.cnt0;
      cur.ans += chld.ans;
    }
    cur.totCnt1 = cur.cnt1;
    for (auto chld : children) {
      long long other0 = cur.cnt0 - chld.cnt1;
      long long other1 = cur.cnt1 - chld.cnt0;
      cur.totCnt1 += chld.cnt1 * other1 + chld.cnt0 * other0;
      cur.totS0 += chld.getS0() * other0 + chld.getS1() * other1;
      cur.totS1 += chld.getS1() * other0 + chld.getS0() * other1;
    }
    cur.totCnt1 /= 2;
    cur.ans += cur.totS0 / 2 + (cur.totS1 + cur.totCnt1) / 2;
    return cur;
  };
  return dfs(0, 0).ans;
}
long long naive(Graph &g) {
  int n = g.size();
  long long ans = 0;
  for (int v0 = 0; v0 < n; v0++) {
    vector<int> dist(n, -1);
    dist[v0] = 0;
    vector<int> q = {v0};
    for (int qi = 0; qi < q.size(); qi++) {
      int v = q[qi];
      for (int u : g[v]) {
        if (dist[u] == -1) {
          dist[u] = dist[v] + 1;
          q.push_back(u);
        }
      }
    }
    for (int v = 0; v < n; v++) {
      ans += (dist[v] + 1) / 2;
    }
  }
  return ans / 2;
}
int randTest() {
  int n = 1000;
  while (true) {
    Graph g(n);
    vector<pair<int, int>> es;
    for (int i = 1; i < n; i++) {
      int p = rand() % i;
      g[i].push_back(p);
      g[p].push_back(i);
      es.push_back({p + 1, i + 1});
    }
    auto expected = naive(g);
    auto actual = solve(g);
    if (expected != actual) {
      cout << actual << " expected " << expected << endl;
      cout << n << endl;
      for (auto pr : es) {
        cout << pr.first << " " << pr.second << endl;
      }
      return 1;
    } else {
      cout << "ok" << endl;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  Graph g(n);
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  cout << solve(g) << endl;
}
