#include <bits/stdc++.h>
int count(int* mas) {
  int a = 0;
  for (int i = 0; i < 100; i++)
    if (mas[i] != 0) a++;
  return a;
}
int find_max(int* mas, int g) {
  int max = 0;
  for (int i = 0; i < 100; i++) {
    if (mas[i] > max) max = mas[i];
  }
  if (max % g == 0)
    return max / g;
  else
    return (max / g) + 1;
}
int main() {
  int n, g, tmp, sum;
  scanf("%d%d", &n, &g);
  int mas[100];
  for (int i = 0; i < 100; i++) mas[i] = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &tmp);
    mas[tmp - 1] += 1;
  }
  sum = g * find_max(mas, g) * count(mas) - n;
  printf("%d", sum);
  return 0;
}
