#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, a[105], temp, maxx = 0, types = 0, x = 1;
  cin >> n >> k;
  for (int i = 0; i <= 104; i++) {
    a[i] = 0;
  }
  for (int i = 0; i < n; i++) {
    cin >> temp;
    a[temp]++;
    if (a[temp] == 1) types++;
    maxx = max(a[temp], maxx);
  }
  x = maxx / k;
  if (maxx % k > 0) x++;
  cout << types * x * k - n;
  return 0;
}
