#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  int utensils[100];
  for (int i = 0; i < 100; i++) {
    utensils[i] = 0;
  }
  int temp;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> temp;
    utensils[temp - 1]++;
  }
  int setSize = 0;
  for (int i = 0; i < 100; i++) {
    if (utensils[i] != 0) {
      setSize++;
    }
  }
  int numDish = 0;
  for (int i = 0; i < 100; i++) {
    if (utensils[i] != 0) {
      temp = ((utensils[i] - 1) / k) + 1;
      if (temp > numDish) {
        numDish = temp;
      }
    }
  }
  cout << (k * numDish * setSize) - n << endl;
  return 0;
}
