#include <bits/stdc++.h>
using namespace std;
long long n, a, b, ans, vis[200005], odd, even;
vector<long long> adj[100005];
void dfs(long long x) {
  vis[x] % 2 == 0 ? even++ : odd++;
  long long sz = adj[x].size();
  for (int i = 0; i < sz; i++) {
    long long y = adj[x][i];
    if (vis[y] == -1) {
      vis[y] = (vis[x] ^ 1);
      dfs(y);
    }
  }
}
int main() {
  cin >> n;
  for (int i = 1; i < n; i++) {
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  memset(vis, -1, sizeof vis);
  odd = even = 0;
  vis[1] = 1;
  dfs(1);
  ans = ((odd * even) - (n - 1));
  cout << ans << endl;
  return 0;
}
