#include <bits/stdc++.h>
using namespace std;
bool compare(int a, int b) { return a > b; }
long long s, a[200000], b[200000], st[200000];
vector<long long> t[100005];
vector<long long> m, n;
void allot(long long h, long long g) {
  if (g != 0) {
    if (st[g] == 1) {
      n.push_back(h);
      st[h] = 2;
    } else {
      m.push_back(h);
      st[h] = 1;
    }
  }
  if (h != 1 && t[h].size() == 1) return;
  for (long long i = 0; i <= t[h].size() - 1; i += 1) {
    if (g != 0 && t[h][i] == g) continue;
    allot(t[h][i], h);
  }
}
int main() {
  cin >> s;
  for (long long i = 1; i <= s - 1; i += 1) cin >> a[i] >> b[i];
  memset(st, 0, sizeof(st));
  m.push_back(1);
  for (long long i = 1; i <= s - 1; i += 1) {
    t[a[i]].push_back(b[i]);
    t[b[i]].push_back(a[i]);
  }
  st[1] = 1;
  allot(1, 0);
  memset(st, 0, sizeof(st));
  long long p = m.size(), q = n.size();
  for (long long i = 0; i <= m.size() - 1; i += 1) {
    if (st[m[i]] == 1) p--;
    st[m[i]] = 1;
  }
  memset(st, 0, sizeof(st));
  for (long long i = 0; i <= n.size() - 1; i += 1) {
    if (st[n[i]] == 1) q--;
    st[n[i]] = 1;
  }
  cout << (p * q - (s - 1));
  return 0;
}
