#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system(“pause”) or input loop */
int main(int argc, char argv[])
{
int n,a[1000],i,j,k;
k=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
{
for(j=i+1;j<n;j++)
{
if(a[i](-1)==a[j])
k=k+1;
}
}
printf("%d",k);
return 0;
}