#include <bits/stdc++.h>
using namespace std;
vector<int> a[11111];
int ji[11111];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    a[x].push_back(y);
    a[y].push_back(x);
  }
  int m = 0;
  for (int i = 1; i <= n; i++) {
    int x = a[i].size();
    memset(ji, 0, sizeof(ji));
    ji[i]++;
    for (int j = 0; j < x; j++) {
      int y = a[i][j];
      if (ji[y]) continue;
      ji[y]++;
      for (int k = 0; k < a[y].size(); k++) {
        if (ji[a[y][k]]) continue;
        ji[a[y][k]]++;
        m++;
      }
    }
  }
  printf("%d\n", m / 2);
  return 0;
}
