#include <fstream>
#include <iostream>
using namespace std;
bool m[100][100];
int main(){
ifstream f("graf.in");
int n,i,j;
f >> n;
while(!f.eof()){
f >> i >> j;
m[i][j] = 1;
m[j][i] = 1;
}
int nr=0;
for(i=1;i<=n;i++){
for(j=i+1;j<=n;j++){
if(m[i][j]) nr++;
}
}
cout << n(n-1)/2 - nr;
}