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