#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, temp;
  int a[100] = {0};
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> temp;
    a[temp - 1]++;
  }
  int types = 0, maxim = 0;
  for (int i = 0; i < 100; i++) {
    maxim = max(maxim, a[i]);
    if (a[i]) types++;
  }
  types *= ((maxim - 1) / k + 1) * k;
  cout << types - n << endl;
  return 0;
}
