#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 1;
const long long INF = 1e9 + 7;
vector<long long> adj[N];
long long col[N];
bool vis[N];
long long ct[2];
void dfs(long long node, long long c) {
  vis[node] = true;
  col[node] = c;
  ct[c]++;
  for (auto it : adj[node]) {
    if (!vis[it]) {
      dfs(it, !c);
    }
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  for (long long i = 0; i < n - 1; i++) {
    long long a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  dfs(1, 0);
  cout << (ct[0] * ct[1]) - (n - 1) << '\n';
}
