#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, guests;
  cin >> n >> guests;
  int tools[101] = {0};
  int max = 0;
  for (int i = 0; i < n; i++) {
    int cur;
    cin >> cur;
    tools[cur]++;
    if (tools[cur] > max) {
      max = tools[cur];
    }
  }
  int tmp = max % guests;
  max -= tmp;
  if (tmp > 0) max += guests;
  int missing = 0;
  for (int i = 1; i < 101; i++) {
    if (tools[i]) missing += max - tools[i];
    assert(tools[i] >= 0);
  }
  cout << missing;
  return 0;
}
