#include <bits/stdc++.h>
using namespace std;
int a[101];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    int q;
    cin >> q;
    a[q]++;
  }
  int ma = 0;
  int df = 0;
  for (int i = 1; i < 101; i++) {
    ma = max(ma, a[i]);
    if (a[i] != 0) df++;
  }
  while (ma % k != 0) ma++;
  while (n > ma * df) df++;
  cout << ma * df - n;
  return 0;
}
