#include <bits/stdc++.h>
using namespace std;
const int odd = 1, even = 2;
void dfs(int node, const vector<vector<int>>& adj_list, vector<int>& type,
         int value);
int main() {
  int nodes;
  while (cin >> nodes) {
    vector<vector<int>> adj_list(nodes);
    for (int i = 1; i < nodes; i++) {
      int a, b;
      cin >> a >> b;
      a--;
      b--;
      adj_list[a].push_back(b);
      adj_list[b].push_back(a);
    }
    vector<int> type(nodes);
    dfs(0, adj_list, type, odd);
    int odds = count(type.begin(), type.end(), odd);
    int evens = count(type.begin(), type.end(), even);
    long long edges = static_cast<long long>(odds) * evens - nodes + 1;
    cout << edges << '\n';
  }
}
void dfs(int node, const vector<vector<int>>& adj_list, vector<int>& type,
         int value) {
  type[node] = value;
  for (int i = 0; i < adj_list[node].size(); i++)
    if (!type[adj_list[node][i]])
      dfs(adj_list[node][i], adj_list, type, 3 - value);
}
