#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int x;
  int arr[100];
  for (int i = 0; i < 100; i++) {
    arr[i] = 0;
  }
  for (int i = 0; i < n; i++) {
    cin >> x;
    arr[x - 1] += 1;
  }
  int max = k;
  for (int i = 0; i < 100; i++)
    if (arr[i] > max) max = arr[i];
  int kom = 1;
  if (max % k == 0)
    kom = max / k;
  else
    kom = max / k + 1;
  int stolen = 0;
  for (int i = 0; i < 100; i++) {
    if (arr[i] != 0) stolen += k * kom - arr[i];
  }
  cout << stolen << endl;
  return 0;
}
