#include <bits/stdc++.h>
int main() {
  int type = 0, s[105], s1[105], n, k, max;
  memset(s, '\0', sizeof(s));
  memset(s1, '\0', sizeof(s1));
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &s[i]);
  }
  for (int i = 0; i < n - 1; i++) {
    for (int k = i + 1; k < n; k++) {
      if (s[i] == s[k]) {
        s1[i]++;
      }
    }
  }
  max = s1[0];
  for (int i = 1; i < n; i++) {
    if (max < s1[i]) max = s1[i];
  }
  max += 1;
  int z = k;
  while (max > k) {
    k += z;
  }
  int count = 0;
  for (int i = 0; i < n; i++) {
    int t = 0;
    for (int j = i - 1; j >= 0; j--) {
      if (s[i] == s[j]) t++;
    }
    if (!t) {
      count++;
    }
  }
  int re = count * k - n;
  printf("%d", re);
}
