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