#include <bits/stdc++.h>
using namespace std;
const int N = 1e6;
vector<int> gr[N];
long long int edges, z, o;
int col[N], vis[N];
void color(int n) {
  for (int i = 0; i < gr[n].size(); i++) {
    if (col[gr[n][i]] == -1) {
      if (col[n] == 0) {
        o++;
        col[gr[n][i]] = 1;
      } else {
        z++;
        col[gr[n][i]] = 0;
      }
      edges++;
      color(gr[n][i]);
    }
  }
}
int main() {
  int n, a, b;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    col[i] = -1;
    cin >> a >> b;
    gr[a].push_back(b);
    gr[b].push_back(a);
  }
  col[n - 1] = -1;
  col[n] = -1;
  col[1] = 0;
  z++;
  color(1);
  if (n == 1) {
    cout << 0 << endl;
  } else {
    cout << z * o - edges << endl;
  }
  return 0;
}
