#include <bits/stdc++.h>
using namespace std;
int v[110];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    int nr;
    cin >> nr;
    v[nr]++;
  }
  int MAX = 0;
  for (int i = 1; i <= 100; i++) {
    int now = v[i] / k + (v[i] % k != 0);
    now *= k;
    MAX = max(MAX, now);
  }
  int cont = 0;
  for (int i = 1; i <= 100; i++) {
    if (v[i]) {
      cont += MAX - v[i];
    }
  }
  cout << cont;
  return 0;
}
