#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, i, s = 0, t = 0, bl;
  int a[100], b[100], c[100];
  cin >> n >> k;
  for (i = 0; i < 100; i++) {
    b[i] = 0;
    c[i] = 0;
  }
  for (i = 0; i < n; i++) {
    cin >> a[i];
    b[a[i] - 1] = 1;
    c[a[i] - 1] = c[a[i] - 1] + 1;
  }
  for (i = 0; i < 100; i++) {
    s = s + b[i];
    if (c[i] > t) t = c[i];
  }
  bl = ceil((double)t / k);
  cout << bl * s * k - n;
}
