#include <bits/stdc++.h>
using namespace std;
vector<bool> visited;
vector<vector<int> > adj;
void dfs(int node, long long &s0, long long &s1, int mod) {
  if (mod == 0)
    s0++;
  else
    s1++;
  visited[node] = true;
  for (int i = 0; i < adj[node].size(); i++) {
    if (!visited[adj[node][i]]) {
      dfs(adj[node][i], s0, s1, (mod + 1) % 2);
    }
  }
}
int main() {
  int t = 1;
  while (t--) {
    int n;
    cin >> n;
    adj = vector<vector<int> >(n + 1);
    visited = vector<bool>(n + 1, false);
    for (int i = 0; i < n - 1; i++) {
      int a, b;
      cin >> a >> b;
      adj[a].push_back(b);
      adj[b].push_back(a);
    }
    long long s0 = 0, s1 = 0;
    dfs(1, s0, s1, 0);
    cout << s0 * s1 - n + 1 << '\n';
  }
  return 0;
}
