#include <bits/stdc++.h>
using namespace std;
int n, a, b, sz[2], belong[100001];
vector<int> e[100001];
void dfs(int idx, int cc) {
  belong[idx] = cc;
  sz[cc]++;
  int to = 0;
  for (int i = 0; i < (int)e[idx].size(); i++) {
    to = e[idx][i];
    if (belong[to] == -1) {
      dfs(to, cc ^ 1);
    }
  }
}
int main() {
  scanf("%d", &n);
  memset(belong, -1, sizeof(belong));
  for (int i = 1; i < n; i++) {
    cin >> a >> b;
    e[a].push_back(b);
    e[b].push_back(a);
  }
  dfs(1, 0);
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    if (belong[i] != 0) {
      continue;
    }
    ans += sz[1] - (int)e[i].size();
  }
  cout << ans << endl;
  return 0;
}
