#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int a[n], count[101] = {0};
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    count[a[i]]++;
  }
  sort(count + 1, count + 101);
  int dish = (count[100] + k - 1) / k, num = 0;
  for (int i = 100; i > 0; i--) {
    if (count[i] > 0)
      num++;
    else
      break;
  }
  cout << dish * num * k - n;
  return 0;
}
