#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  vector<long long> val(101, 0);
  long long in = 0, mx = -1;
  for (int i = 0; i != n; ++i) {
    int vr;
    cin >> vr;
    if (val[vr] == 0) ++in;
    val[vr]++;
    mx = max(mx, val[vr]);
  }
  long long aaa = (mx - 1) / k + 1;
  cout << aaa * in * k - n << endl;
}
