#include <bits/stdc++.h>   using namespace std;   int main() {     long long n, m, f[10] = {0}, x, i;     long long ans, z;     scanf( %lld , &n);     scanf( %lld , &m);     for (i = 0; i < n; i++) {       scanf( %lld , &x);       f[x - 1]++;     }     ans = (n * (n - 1)) / 2;     for (i = 0; i < m; i++) {       z = (f[i] * (f[i] - 1)) / 2;       ans -= z;     }     cout << ans;   }   