#include <bits/stdc++.h>
using namespace std;
vector<int> edge[100010];
long long int visited[100010], bi[100010];
void dfs(int num, int onetwo) {
  int i;
  for (i = 0; i < edge[num].size(); i++) {
    if (!visited[edge[num][i]]) {
      visited[edge[num][i]] = 1;
      bi[edge[num][i]] = onetwo;
      dfs(edge[num][i], (onetwo + 1) % 2);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, i, a, b;
  cin >> n;
  for (i = 0; i < n - 1; i++) {
    cin >> a >> b;
    edge[a].push_back(b);
    edge[b].push_back(a);
  }
  bi[1] = 0;
  visited[1] = 1;
  dfs(1, 1);
  long long int cm = 0, cn = 0;
  for (i = 1; i <= n; i++) {
    if (bi[i] == 0)
      cm++;
    else if (bi[i] == 1)
      cn++;
  }
  cout << (cm * cn) - (n - 1);
  return 0;
}
