#include <bits/stdc++.h>
using namespace std;
vector<int> ed[100005], odd, even;
bool done[100005];
int lvl[100005];
void dfs(int x, int y) {
  lvl[x] = y;
  done[x] = true;
  if (y & 1)
    odd.push_back(x);
  else
    even.push_back(x);
  int xx = ed[x].size();
  for (int i = 0; i < xx; i++) {
    int v = ed[x][i];
    if (!done[v]) dfs(v, y + 1);
  }
}
int main() {
  int n, a, b;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    cin >> a >> b;
    ed[a].push_back(b);
    ed[b].push_back(a);
  }
  dfs(1, 0);
  long long rslt = 0;
  for (int i = 1; i <= n; i++) {
    if (lvl[i] & 1) {
      rslt += ((long long)even.size() - (long long)ed[i].size());
    } else
      rslt += ((long long)odd.size() - (long long)ed[i].size());
  }
  rslt /= 2LL;
  cout << rslt << endl;
}
