#include <bits/stdc++.h>
using namespace std;
vector<int> tree[10000];
int main() {
  int n;
  cin >> n;
  int a, b;
  for (int i = 0; i < n - 1; i++) {
    cin >> a >> b;
    --a;
    --b;
    tree[a].push_back(b);
    tree[b].push_back(a);
  }
  uint64_t totalSum = 0;
  uint64_t compensation = 0;
  uint64_t localSum = 0;
  for (int i = 0; i < n; i++) {
    vector<int>& current = tree[i];
    localSum = 0;
    for (int j = 0; j < current.size(); j++) {
      int other = current[j];
      if (other != i) {
        localSum += tree[other].size() - 1;
      }
    }
    if (localSum & 1 == 1) {
      compensation += 1;
    }
    totalSum += localSum / 2;
  }
  totalSum += compensation / 2;
  cout << totalSum << endl;
}
