#include <bits/stdc++.h>
using namespace std;
int color[100005];
int marked[100005];
set<int> adj[100005];
void bfs(int s) {
  queue<int> vert;
  color[s] = 0;
  vert.push(s);
  while (!vert.empty()) {
    int f = vert.front();
    vert.pop();
    marked[f] = true;
    for (auto v : adj[f]) {
      if (!marked[v]) {
        vert.push(v);
        color[v] = (color[f] + 1) % 2;
      }
    }
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    adj[a].insert(b);
    adj[b].insert(a);
  }
  bfs(0);
  long long r = 0, b = 0;
  for (int i = 0; i < n; i++) {
    if (color[i] == 0)
      r++;
    else
      b++;
  }
  cout << r * b - (n - 1) << "\n";
}
