#include <bits/stdc++.h>
using namespace std;
long long const N = 110;
long long a[N];
long long n, k;
long long result;
long long Min(long long a, long long b) { return a < b ? a : b; }
long long Max(long long a, long long b) { return a > b ? a : b; }
bool Input() {
  long long i;
  memset(a, 0, sizeof(long long) * N);
  if (scanf("%I64d%I64d", &n, &k) != EOF) {
    for (i = 1; i <= n; i++) {
      long long temp = 0;
      scanf("%I64d", &temp);
      a[temp]++;
    }
    return true;
  }
  return false;
}
void Solve() {
  long long max_i = 0;
  long long max_cnt = 0;
  long long last_tool = 0;
  long long sum = 0;
  max_i = 0;
  max_cnt = a[0];
  for (long long i = 1; i < N; ++i) {
    if (a[i] > max_cnt) {
      max_i = i;
      max_cnt = a[i];
    }
  }
  if (max_cnt % k != 0) {
    last_tool = max_cnt + k - max_cnt % k;
  } else {
    last_tool = max_cnt;
  }
  sum = 0;
  for (long long i = 0; i < N; ++i) {
    if (a[i] != 0) {
      sum += (last_tool - a[i]);
    }
  }
  result = sum;
}
int main() {
  while (Input()) {
    result = 0;
    Solve();
    printf("%I64d\n", result);
  }
  return 0;
}
