#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int can = 0;
  int person = 0;
  int sol = 1;
  int maxtyp = 0;
  cin >> can >> person;
  int last[101];
  for (int i = 0; i <= 100; i++) last[i] = 0;
  for (int i = 0; i < can; i++) {
    cin >> sol;
    last[sol]++;
  }
  int diferents = 0;
  for (int i = 0; i <= 100; i++) {
    if (last[i] != 0) diferents++;
    if (last[i] > maxtyp) maxtyp = last[i];
  }
  int platos = 0;
  if (maxtyp % person != 0) {
    platos = maxtyp / person + 1;
  } else
    platos = maxtyp / person;
  cout << person * diferents * platos - can << endl;
  return 0;
}
