#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> cnt(100);
  for (int i = 0; i < n; i++) {
    int tmp;
    cin >> tmp;
    tmp--;
    cnt[tmp]++;
  }
  int mx = 0;
  for (int i = 0; i < 100; i++) {
    if (!cnt[i]) continue;
    mx = max(mx, cnt[i]);
  }
  int ans1 = 0;
  for (int i = 0; i < 100; i++) {
    if (!cnt[i]) continue;
    ans1 += mx - cnt[i];
    if (mx % k != 0) ans1 += k - mx % k;
  }
  cout << ans1;
  return 0;
}
