#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c = 0;
  cin >> a >> b;
  int x[a];
  int y[101];
  int z[101];
  for (int i = 0; i < 101; i++) {
    y[i] = 0;
    z[i] = 0;
  }
  for (int i = 0; i < a; i++) {
    cin >> x[i];
    y[x[i]] = 1;
    z[x[i]] += 1;
  }
  int max = 0;
  for (int i = 1; i < 101; i++) {
    c += y[i];
    if (max < z[i]) {
      max = z[i];
    }
  }
  while (max % b != 0) {
    max += 1;
  }
  cout << max * c - a;
}
