#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int a[n], utype[101] = {0};
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    utype[a[i]]++;
  }
  int maxim = 0;
  int type = 0;
  for (int i = 1; i <= 100; i++) {
    if (utype[i] != 0) type++;
    maxim = max(utype[i], maxim);
  }
  int dishes;
  if (maxim % k == 0)
    dishes = maxim / k;
  else
    dishes = (maxim / k) + 1;
  int used = k * type * dishes;
  int stolen = used - n;
  cout << stolen;
}
