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