#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int k;
  cin >> n >> k;
  int x;
  int a[101];
  memset(a, 0, sizeof(a));
  for (int i = 0; i < n; i++) {
    cin >> x;
    a[x]++;
  }
  int max = 0;
  for (int i = 0; i < 101; i++) {
    if (a[i] > max) max = a[i];
  }
  if (max % k) {
    max += k - max % k;
  }
  int sum = 0;
  for (int i = 0; i < 101; i++) {
    if (a[i] != 0) {
      sum += max - a[i];
    }
  }
  cout << sum << endl;
  return 0;
}
