#include <bits/stdc++.h>
using namespace std;
const int N = 123;
const int INF = 1e9 + 123;
const int MOD = 1e9 + 7;
const double EPS = 1e-9;
int n, k, a[N], ans, mx, cnt[N];
bool u[N];
int main() {
  ios_base ::sync_with_stdio(0);
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    ++cnt[a[i]];
    mx = max(mx, cnt[a[i]]);
  }
  if (mx > k) {
    int x = k;
    while (k < mx) {
      k += x;
    }
    mx = k;
  } else
    mx = k;
  for (int i = 1; i <= n; ++i) {
    if (!u[a[i]]) {
      u[a[i]] = 1;
      ans += (mx - cnt[a[i]]);
    }
  }
  cout << ans;
  return 0;
}
