#include <bits/stdc++.h>
using namespace std;
const double pi = 2 * acos(0);
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> adj[n + 1];
  vector<int> side(n + 1, -1);
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  queue<int> q;
  for (int i = 1; i <= n; i++) {
    if (side[i] == -1) {
      q.push(i);
      side[i] = 0;
      while (!q.empty()) {
        int v = q.front();
        q.pop();
        for (auto u : adj[v]) {
          if (side[u] == -1) {
            side[u] = side[v] ^ 1;
            q.push(u);
          }
        }
      }
    }
  }
  long long l = 0;
  for (int i = 1; i <= n; i++) {
    if (side[i]) l++;
  }
  long long ans = (l * (n - l)) - (n - 1);
  cout << ans << "\n";
  return 0;
}
