#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
long long n, m, k, x, y, z;
bool sortbysec(const pair<long long, long long> &a,
               const pair<long long, long long> &b) {
  return (a.second < b.second);
}
bool sortbyfi(const pair<long long, pair<long long, long long>> &a,
              const pair<long long, pair<long long, long long>> &b) {
  return (a.first > b.first);
}
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>>
    pq;
void Birdperson() {
  cin >> n >> m;
  int a[11];
  memset(a, 0, sizeof(a));
  for (long long i = 0; i < n; i++) {
    cin >> x;
    a[x]++;
  }
  long long ans = 0;
  for (int i = 1; i <= 10; i++) {
    for (int j = i + 1; j <= 10; j++) {
      ans += (a[i] * a[j]);
    }
  }
  cout << ans << "\n";
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    Birdperson();
  }
  return 0;
}
