#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int a[n], c = 0, sum = 0;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    if (count(a, a + n, a[i]) > c) c = count(a, a + n, a[i]);
    i = i + count(a, a + n, a[i]) - 1;
  }
  if (c % k != 0) c = c - c % k + k;
  for (int i = 0; i < n; i++) {
    sum = sum + (c - count(a, a + n, a[i]));
    i = i + count(a, a + n, a[i]) - 1;
  }
  cout << sum << endl;
  return 0;
}
