#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int N = 200031;
int n;
vector<int> g[N];
int used[N];
int cnt[N];
void dfs(int v, int clr) {
  cnt[clr]++;
  used[v] = 1;
  for (int i = 0; i < g[v].size(); i++) {
    int to = g[v][i];
    if (used[to]) continue;
    dfs(to, clr ^ 1);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i < n; i++) {
    int a, b;
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dfs(1, 0);
  cout << 1ll * cnt[0] * cnt[1] - (n - 1) << endl;
  cin.get();
  cin.get();
  return 0;
}
