#include <bits/stdc++.h>
using namespace std;
vector<int> g[10100];
int nrc[10100];
void dfs(int node, int parent) {
  for (const auto &it : g[node])
    if (it != parent) {
      nrc[node]++;
      dfs(it, node);
    }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    int x, y;
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs(1, 0);
  long long sol = 0;
  for (int i = 1; i <= n; i++) {
    sol += (nrc[i] * (nrc[i] - 1)) / 2;
    sol += nrc[i];
  }
  sol -= nrc[1];
  cout << sol << '\n';
  return 0;
}
