#include <bits/stdc++.h>
using namespace std;
int i, j, k, n, m, l;
const int N = 1e5 + 8;
int vis[N];
vector<int> adj[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  for (i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  queue<int> q;
  q.push(1);
  memset(vis, 0, sizeof(vis));
  vis[1] = 1;
  l = 0;
  long long ev = 0, od = 0;
  while (1) {
    int c = q.size();
    if (!c) break;
    while (c) {
      int s = q.front();
      q.pop();
      c--;
      if (l & 1)
        ev++;
      else
        od++;
      for (auto u : adj[s]) {
        if (!vis[u]) {
          vis[u] = 1;
          q.push(u);
        }
      }
    }
    l++;
  }
  cout << (ev * od - (n - 1)) << "\n";
  return 0;
}
