#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, a[101] = {0};
  cin >> n >> k;
  for (int i = 0; i < n; ++i) {
    int p;
    cin >> p;
    a[p]++;
  }
  int max_cutlery = *max_element(a, a + 101);
  int min_dishes = (max_cutlery - 1) / k + 1;
  int min_cutlery = min_dishes * k;
  int lost = 0;
  for (int p = 0; p <= 100; ++p) {
    if (a[p] > 0 && a[p] < min_cutlery) lost += min_cutlery - a[p];
  }
  cout << lost << endl;
  return 0;
}
