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