#include <bits/stdc++.h>
using namespace std;
int main() {
  std::cout.precision(2);
  std::cout.setf(std::ios::fixed);
  int n, k, m = 0;
  string s;
  int arr[101] = {0};
  cin >> n >> k;
  cin.ignore();
  getline(cin, s);
  for (int i = 0; i <= s.size(); ++i) {
    if (s[i] == ' ' || s[i] == '\0') {
      arr[stoi(s.substr(m, i - m + 1))] += 1;
      m = i + 1;
    }
  }
  int max = -1, maxval = -1, not_zero = 0;
  for (int i = 0; i < 101; ++i) {
    if (arr[i] >= maxval) {
      max = i;
      maxval = arr[i];
    }
  }
  for (int i = 0; i < 101; ++i) {
    if (arr[i] != 0) {
      not_zero += 1;
    }
  }
  float div;
  div = (float)maxval / k;
  int min_dishes = ceil(div);
  int utensils = min_dishes * not_zero * k;
  cout << utensils - n;
  return 0;
}
