#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, el, a, b;
  cin >> n;
  vector<int> data[n + 1];
  int ansset[n + 1];
  int vis[n + 1];
  for (i = 0; i < n - 1; i++) {
    cin >> a >> b;
    data[a].push_back(b);
    data[b].push_back(a);
    vis[i + 1] = 0;
  }
  vis[n] = 0;
  vector<int> aset;
  vector<int> bset;
  queue<int> s;
  s.push(1);
  vis[1] = 1;
  aset.push_back(1);
  ansset[1] = 1;
  while (s.size() > 0) {
    el = s.front();
    s.pop();
    for (i = 0; i < data[el].size(); i++) {
      if (vis[data[el][i]] == 0) {
        s.push(data[el][i]);
        ansset[data[el][i]] = ansset[el] % 2 + 1;
        vis[data[el][i]] = 1;
        if (ansset[data[el][i]] == 1) {
          aset.push_back(data[el][i]);
        } else {
          bset.push_back(data[el][i]);
        }
      }
    }
  }
  long long int ans = 0;
  for (i = 0; i < aset.size(); i++) {
    ans = ans + (bset.size() - data[aset[i]].size());
  }
  cout << ans << endl;
  return 0;
}
