#include <bits/stdc++.h>
using namespace std;
int a, b, c[101], d, e, f, g;
int main() {
  cin >> a >> b;
  for (; d < a; d++) {
    cin >> e;
    c[e]++;
    f = max(f, c[e]);
    if (c[e] == 1) {
      g++;
    }
  }
  f = (f % b) ? (f / b + 1) * b : f;
  cout << f * g - a;
  return 0;
}
