#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-') f = -1;
  for (; c >= '0' && c <= '9'; c = getchar()) x = x * 10 + c - '0';
  return x * f;
}
int n, m;
int a[15];
int main() {
  n = read(), m = read();
  for (int i = (1); i <= (n); i++) {
    int x = read();
    a[x]++;
  }
  int ans = 0;
  for (int i = (1); i <= (m); i++)
    for (int j = (i + 1); j <= (m); j++) {
      ans += a[i] * a[j];
    }
  printf("%d\n", ans);
}
