#include <bits/stdc++.h>
const double pi = acos(-1.0);
const double eps = 1e-9;
const double deg = pi / 180;
const int inf = 2e9;
const int base = 2011;
const int raz = 2e5 + 5;
const int mod = 1e9 + 7;
const int sz = 1e5 + 5;
using namespace std;
bool u[sz];
vector<vector<int> > g(sz), col(3);
void dfs(int v, int c) {
  u[v] = 1;
  col[c].push_back(v);
  for (int to : g[v])
    if (!u[to]) dfs(to, 3 - c);
}
int main() {
  long long ans = 0;
  int n;
  scanf("%d", &n);
  for (int i = 1, u, v; i < n; i++) {
    scanf("%d %d", &u, &v);
    g[v].push_back(u);
    g[u].push_back(v);
  }
  dfs(1, 1);
  for (int f : col[1]) {
    ans += (int)(col[2].size() - g[f].size());
  }
  printf("%lld", ans);
  return 0;
}
