#include <bits/stdc++.h>
using namespace std;
int n, k;
int cnt[105];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  memset(cnt, 0, sizeof(cnt));
  cin >> n >> k;
  int a;
  for (int i = (0); i != (n); ++i) {
    cin >> a;
    cnt[a]++;
  }
  int maxcnt = 0, type = 0;
  for (int i = (1); i != (101); ++i) {
    maxcnt = max(cnt[i], maxcnt);
    if (cnt[i] > 0) type++;
  }
  int b = 1;
  while (k * b < maxcnt) b++;
  cout << b * type * k - n << endl;
  return 0;
}
