#include <bits/stdc++.h>
using namespace std;
long long n;
vector<vector<long long> > a;
vector<long long> color;
long long g1, g2;
void isBipartite() {
  color[0] = 1;
  queue<int> q;
  q.push(0);
  while (!q.empty()) {
    int temp = q.front();
    q.pop();
    for (long long i = 0; i < a[temp].size(); i++) {
      if (color[a[temp][i]] == -1) {
        color[a[temp][i]] = !color[temp];
        q.push(a[temp][i]);
      }
    }
  }
  for (long long i = 0; i < n; i++) {
    if (color[i] == 1)
      g1++;
    else
      g2++;
  }
}
int main() {
  cin >> n;
  long long x, y;
  a = vector<vector<long long> >(n);
  set<long long> st1, st2;
  vector<long long> deg(n, 0);
  g1 = 0;
  g2 = 0;
  color = vector<long long>(n, -1);
  for (int i = 0; i < n - 1; i++) {
    cin >> x >> y;
    x--;
    y--;
    a[x].push_back(y);
    a[y].push_back(x);
    deg[x]++;
    deg[y]++;
  }
  long long cnt = 0;
  isBipartite();
  for (int i = 0; i < n; i++) {
    if (color[i] == 1) {
      cnt += g2 - deg[i];
    }
  }
  cout << cnt << endl;
}
