#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, n, k, i, j, diff = 0;
  int *m = new int[100];
  cin >> n >> k;
  for (i = 0; i < 100; i++) {
    m[i] = 0;
  }
  for (i = 0; i < n; i++) {
    cin >> a;
    if (m[a - 1] == 0) {
      diff += 1;
    }
    m[a - 1] += 1;
  }
  int max = 0;
  for (i = 0; i < 100; i++) {
    if (m[i] > max) {
      max = m[i];
    }
  }
  int o = (max / k);
  if (max % k != 0) {
    o++;
  }
  cout << o * k * diff - n;
  return 0;
}
