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