#include <bits/stdc++.h>
using namespace std;
int v[101];
int main() {
  int a, b;
  cin >> a >> b;
  for (int i = 0; i < a; i++) {
    int r;
    cin >> r;
    v[r]++;
  }
  int ma = 0;
  for (int i = 1; i <= 100; i++) {
    if (v[i] > ma) {
      ma = v[i];
    }
  }
  int r = ceil(ma * 1.0 / b);
  int x = r * b;
  int c = 0;
  for (int i = 1; i <= 100; i++) {
    if (v[i] > 0) {
      c += x - v[i];
    }
  }
  cout << c;
  return 0;
}
