#include <bits/stdc++.h>
int main() {
  int n, k, a, maxNumUtensils = 0, numUtensilsTypes = 0;
  int utensils[101] = {0};
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a);
    if (utensils[a] == 0) numUtensilsTypes++;
    utensils[a]++;
    maxNumUtensils = std::max(utensils[a], maxNumUtensils);
  }
  int numDishes = std::ceil((double)maxNumUtensils / k);
  printf("%d\n", numDishes * k * numUtensilsTypes - n);
}
