#include <bits/stdc++.h>
using namespace std;
int n, m, ma, t;
int a[101];
int b[101];
void salvation() {
  cin >> m >> n;
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    b[a[i]]++;
    ma = max(ma, b[a[i]]);
  }
  ma = n * (ma % n == 0 ? ma / n : ma / n + 1);
  for (int i = 1; i < 101; i++) {
    if (b[i] != 0) t += ma - b[i];
  }
  cout << t;
}
int main() {
  salvation();
  return 0;
}
