#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  int i, j, K;
  int num[101];
  memset(num, 0, sizeof(num));
  cin >> n >> k;
  for (i = 0; i < n; i++) {
    scanf("%d", &K);
    num[K]++;
  }
  int cut = 0;
  int Max = 0;
  for (i = 1; i <= 100; i++) {
    if (num[i]) {
      cut++;
      Max = max(Max, num[i]);
    }
  }
  Max % k ? (j = Max / k + 1) : (j = Max / k);
  long long ans = 0;
  ans = cut * j * k - n;
  printf("%lld\n", ans);
}
