#include <bits/stdc++.h>
int main() {
  int n, k, i, A[101], h = 0, S = 0, max = 0, bluda = 0;
  scanf("%d%d", &n, &k);
  for (i = 0; i < 100; i++) {
    A[i] = 0;
  }
  for (i = 0; i < n; i++) {
    scanf("%d", &h);
    A[h - 1]++;
  }
  for (i = 0; i < 100; i++) {
    if (A[i] > max) max = A[i];
  }
  if (max % k != 0) {
    bluda = max / k + 1;
  } else {
    bluda = max / k;
  }
  for (i = 0; i < 100; i++) {
    if (A[i] != 0) {
      A[i] = bluda * k - A[i];
      S = S + A[i];
    }
  }
  printf("%d\n", S);
  return 0;
}
