#include <bits/stdc++.h>
using namespace std;
long long first = 1;
long long second;
vector<vector<long long>> grph;
vector<bool> used;
void dfs(long long v, bool is_first) {
  used[v] = true;
  for (auto u : grph[v]) {
    if (!used[u]) {
      if (is_first) {
        second++;
      } else {
        first++;
      }
      dfs(u, !is_first);
    }
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  long long a, b;
  grph.resize(n);
  used.resize(n);
  for (long long i = 0; i < n - 1; i++) {
    cin >> a >> b;
    grph[a - 1].push_back(b - 1);
    grph[b - 1].push_back(a - 1);
  }
  dfs(0, true);
  cout << first * second - (n - 1);
}
