#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, k, i, max = 0, min = 200, ans = 0, sets = 0, num = 0;
  long a[200], map[200];
  scanf("%ld%ld", &n, &k);
  memset(map, 0, sizeof(map));
  for (i = 0; i < n; ++i) {
    scanf("%ld", &a[i]);
    ++map[a[i]];
  }
  for (i = 1; i <= 100; ++i) {
    if (map[i] > max) max = map[i];
    if (map[i] < min && map[i] != 0) min = map[i];
    if (map[i] > 0) ++num;
  }
  if (max % k == 0)
    sets = max / k;
  else
    sets = max / k + 1;
  ans = sets * num * k - n;
  printf("%ld", ans);
  return 0;
}
