#include <bits/stdc++.h>
using namespace std;
map<long long int, int> mp;
vector<long long int> V[100005];
long long int visited[100005];
long long int indeg[100005];
void dfs(long long int u) {
  visited[u] = 1;
  int sz = V[u].size();
  for (int i = 0; i < sz; i++) {
    int v = V[u][i];
    if (visited[v] == 0) {
      mp[v] = (mp[u] + 1) % 2;
      dfs(v);
    }
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    V[x].push_back(y);
    V[y].push_back(x);
    indeg[x]++;
    indeg[y]++;
  }
  dfs(1);
  long long int one = 0, zero = 0;
  for (int i = 1; i <= n; i++) {
    if (mp[i] == 1)
      one++;
    else if (mp[i] == 0)
      zero++;
  }
  long long int cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (mp[i] == 1)
      cnt += (zero - indeg[i]);
    else
      cnt += (one - indeg[i]);
  }
  printf("%lld\n", cnt / 2);
}
