#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:268435456")
using namespace std;
const int INF = 2147483646;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int mas[101];
  long double n, k;
  int nabk = 0, per = 0;
  long long sk;
  cin >> n >> k;
  for (int i = 0; i < 101; i++) mas[i] = 0;
  for (int i = 0; i < n; i++) {
    cin >> sk;
    mas[sk]++;
  }
  for (int i = 0; i < 101; i++)
    if (mas[i] != 0) per++;
  for (int i = 0; i < 101; i++)
    if (ceil(mas[i] / k) > nabk) nabk = ceil(mas[i] / k);
  int OTV = nabk * k * per;
  cout << OTV - n;
  return 0;
}
