#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, k, in;
  cin >> n >> k;
  vector<int> nab(101, 0);
  for (int i = 1; i <= n; i++) {
    cin >> in;
    nab[in]++;
  }
  int nabm = *(max_element(nab.begin(), nab.end()));
  nabm = (nabm + k - 1) / k * k;
  int viv = 0;
  for (auto x : nab)
    if (x != 0) viv += nabm - x;
  cout << viv;
}
