#include <bits/stdc++.h>
using namespace std;
int a[11];
int main() {
  int n, m, temp, result = 0;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d", &temp);
    a[temp]++;
  }
  for (int i = 1; i < 10; i++)
    for (int j = i + 1; j <= 10; j++) result += a[i] * a[j];
  printf("%d", result);
  return 0;
}
