#include <iostream>
#include <vector>
using namespace std;
int main()
{
int n, counter = 0;
vector <int> arr;
cin >> n;
for(int i = 0 ; i < n ; ++i)
int temp;
cin >> temp;
arr.push_back(temp);
}
for(int i = 0 ; i < arr.size() - 1 ; ++i)
for(int j = i + 1 ; j < arr.size() ; ++j)
if(arr[i] == arr[j])
counter++;
cout << counter;
return 0;
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int n, counter = 0;
vector <int> arr;
cin >> n;
for(int i = 0 ; i < n ; ++i)
{
int temp;
cin >> temp;
arr.push_back(temp);
}
for(int i = 0 ; i < arr.size() - 1 ; ++i)
for(int j = i + 1 ; j < arr.size() ; ++j)
if(arr[i] == arr[j])
counter++;
cout << counter;
return 0;
}