#include <bits/stdc++.h>
using namespace std;
int n, visited[100009];
vector<int> adj[100009];
long long c[2], color[100009], leaf[100009];
void dfs(int i, int col) {
  if (!visited[i]) {
    visited[i] = 1;
    leaf[i] = 1;
    color[i] = col;
    c[col]++;
    int tot = 0;
    for (int j = 0; j < adj[i].size(); j++) {
      if (!visited[adj[i][j]]) tot++;
      dfs(adj[i][j], col ^ 1);
    }
    leaf[i] += tot;
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(1, 0);
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    if (color[i]) ans = ans + c[0] - leaf[i];
  }
  cout << ans;
  return 0;
}
