#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> f(11, 0);
  for (int i = 0, x; i < n; ++i) cin >> x, f[x]++;
  long long res = 0;
  for (int i = 0; i < 11; ++i) {
    if (f[i] == 0) continue;
    long long cnt = 0;
    for (int j = i + 1; j < 11; ++j) {
      if (f[j] == 0) continue;
      cnt += f[j];
    }
    res += (cnt * f[i]);
  }
  cout << res << endl;
  return 0;
}
