#include <bits/stdc++.h>
using namespace std;
vector<long long int> v[100005];
long long int color[100005], dead, pool;
long long int bfs(long long int n) {
  long long int u, i, e;
  color[n] = 1;
  dead = 1;
  queue<long long int> q;
  q.push(n);
  while (!q.empty()) {
    u = q.front();
    q.pop();
    for (i = 0; i < v[u].size(); i++) {
      e = v[u][i];
      if (!color[e]) {
        if (color[u] == 1) {
          color[e] = 2;
          pool++;
        } else {
          color[e] = 1;
          dead++;
        }
        q.push(e);
      }
    }
  }
  return dead * pool;
}
int main() {
  long long int n, x, y, m, k;
  cin >> n;
  for (long long int i = 0; i < n - 1; i++) {
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  k = bfs(1);
  cout << k - (n - 1) << endl;
  return 0;
}
