#include <bits/stdc++.h>
using namespace std;
vector<long long> vi[100001];
bool visited[100001] = {0};
bool col[100001] = {0};
bool is_powertwo(long long n) {
  long long count = 0;
  while (n) {
    if ((n & 1) > 0) count++;
    n = n >> 1;
  }
  if (count == 1) return true;
  return false;
}
void clear(std::queue<char> &q) {
  std::queue<char> empty;
  std::swap(q, empty);
}
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
bool is_prime(long long n) {
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
bool dfs(long long v, long long c) {
  visited[v] = 1;
  col[v] = c;
  for (long long child : vi[v]) {
    if (visited[child] == 0) {
      if (dfs(child, c ^ 1) == false) return false;
    } else {
      if (col[v] == col[child]) return false;
    }
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t;
  t = 1;
  while (t--) {
    long long n, m;
    cin >> n;
    m = n - 1;
    for (long long i = 1; i <= n; i++) {
      vi[i].clear();
      visited[i] = 0;
      col[i] = 0;
    }
    while (m--) {
      long long u, v;
      cin >> u;
      cin >> v;
      vi[u].push_back(v);
      vi[v].push_back(u);
    }
    bool flag = 1;
    for (long long i = 1; i <= n; i++) {
      if (visited[i] == 0) {
        bool res = dfs(i, 0);
        if (res == false) {
          flag = 0;
          break;
        }
      }
    }
    long long c1 = 0;
    long long c2 = 0;
    for (long long i = 1; i <= n; i++) {
      if (col[i] == 0)
        c1++;
      else
        c2++;
    }
    cout << (c1 * c2) - (n - 1) << endl;
  }
  return 0;
}
