#include <bits/stdc++.h>
using namespace std;
vector<long long int> a, b;
string s, t, r;
int main() {
  ios ::sync_with_stdio(false);
  cin.tie(0);
  ;
  long long int i, j = 0, k, l, m = 0, d, n = 0, x = 0, y = 0, z, p = 0, d2,
                   e = 0, g = 1, x1 = 0, y1 = 0, z1, x2 = 0, y2 = 0, z2;
  cin >> n >> k;
  long long int xx[101] = {0};
  for (i = 0; i < n; i++) {
    cin >> x;
    xx[x]++;
  }
  for (i = 1; i < 101; i++)
    if (xx[i]) x1++;
  sort(xx, xx + 101);
  if (xx[100] % k)
    x2 = xx[100] / k + 1;
  else
    x2 = xx[100] / k;
  x1 *= x2 * k;
  cout << (x1 - n) << endl;
  return 0;
}
