#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> forks;
  int a, b, c, d, e, f, g, i, j, k, maxx = 0, meals = 1, ans = 0;
  cin >> a >> b;
  forks.resize(101);
  for (i = 0; i < a; i++) {
    cin >> f;
    forks[f]++;
  }
  for (i = 0; i < 101; i++) {
    if (forks[i] > maxx) {
      maxx = forks[i];
    }
  }
  if (maxx > b) {
    if (maxx % b != 0) {
      meals = (maxx / b) + 1;
    } else {
      meals = maxx / b;
    }
  }
  e = meals * b;
  for (i = 0; i < 101; i++) {
    if (forks[i] < e && forks[i] != 0) {
      ans += e - forks[i];
    }
  }
  cout << ans;
  return (0);
}
