#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, a, max1 = 0, y = 0;
  cin >> n >> k;
  vector<int> q(101, 0);
  for (int i = 0; i < n; ++i) {
    cin >> a;
    ++q[a];
  }
  for (int i = 1; i <= 100; ++i) {
    if (q[i] > max1) max1 = q[i];
    if (q[i]) ++y;
  }
  int t = (max1 - 1) / k + 1;
  cout << t * y * k - n << endl;
  return 0;
}
