#include <bits/stdc++.h>
using namespace std;
map<int, vector<int>> mp;
int ans[2]{0};
int flag = 0;
void dfs(int ver, int x, int pr) {
  ans[x & 1]++;
  for (auto i : mp[ver]) {
    if (i != pr) dfs(i, x + 1, ver);
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    mp[a].push_back(b);
    mp[b].push_back(a);
  }
  dfs(1, 0, 0);
  cout << (long long)ans[0] * ans[1] - (n - 1);
  return 0;
}
