#include <bits/stdc++.h>
using namespace std;
vector<int> adj[100005];
bool vis[100005];
int a[105];
long long cnt = 0;
void dfs(int i, bool b) {
  if (vis[i]) return;
  vis[i] = 1;
  if (b) cnt++;
  for (int j = 0; j < adj[i].size(); j++) dfs(adj[i][j], !b);
}
int main() {
  memset(vis, 0, sizeof vis);
  long long n;
  cin >> n;
  for (int i = 1; i <= n - 1; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(1, 1);
  cout << cnt * (n - cnt) - (n - 1);
  return 0;
}
