#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long h[11] = {0};
  for (long long i = 0; i < n; i++) h[a[i]]++;
  long long sum = 0;
  for (long long i = 1; i <= 10; i++) {
    for (long long j = i + 1; j <= 10; j++) sum += (h[i] * h[j]);
  }
  cout << sum << "\n";
}
