#include <bits/stdc++.h>
using namespace std;
int A[1000000] = {};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long N, d, x, i, j, k = 0, maxi = 0, Y;
  cin >> N >> d;
  for (i = 0; i < N; i++) {
    cin >> x;
    A[x]++;
  }
  for (i = 1; i <= 100; i++) {
    if (A[i] >= maxi) maxi = A[i];
    if (A[i] > 0) k++;
  }
  {
    if (maxi % d == 0)
      Y = maxi / d;
    else
      Y = (maxi / d) + 1;
  }
  cout << setprecision(30) << Y * k * d - N;
  return 0;
}
