#include <bits/stdc++.h>
using namespace std;
int n;
int cnt = 0;
vector<vector<int>> g;
vector<bool> used;
void dfs(int v, int di) {
  used[v] = 1;
  if (di >= 0) {
    for (int u : g[v]) {
      if (!used[u]) {
        dfs(u, di - 1);
      }
    }
  } else {
    cnt++;
  }
}
void clean() {
  for (size_t x = 0; x < used.size(); ++x) used[x] = 0;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    g.push_back(vector<int>());
    used.push_back(0);
  }
  int x, y;
  for (int i = 0; i < n - 1; ++i) {
    cin >> x >> y;
    g[x - 1].push_back(y - 1);
    g[y - 1].push_back(x - 1);
  }
  for (int i = 0; i < n; ++i) {
    dfs(i, 1);
    clean();
  }
  cout << cnt / 2 << endl;
  return 0;
}
