#include <bits/stdc++.h>
using namespace std;
void init() {
  cin.tie(0);
  cin.sync_with_stdio(0);
}
bool iscan(long long mid, long long arr[], long long brr[], long long n,
           long long m) {
  for (int i = 0; i < n; i++) {
    if (mid > arr[i]) {
      if (m >= ((mid - arr[i]) * brr[i]))
        m -= (mid - arr[i]) * brr[i];
      else
        return false;
    }
    return true;
  }
}
long long ans(long long arr[], long long brr[], long long n, long long m) {
  long long l = 0, r = 1e9 + 1e12 + 5, mid, res = 0;
  while (r >= l) {
    mid = l + (r - l) / 2;
    if (iscan(mid, arr, brr, n, m))
      res = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  return res;
}
long long frq[105];
int main() {
  init();
  long long n, k;
  cin >> n >> k;
  long long arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i], frq[arr[i]]++;
  int c = 0;
  while (frq[k] < n) {
    int o = 0;
    while (o < k) {
      if (frq[o] > 0) {
        frq[o]--;
        if (frq[o + 1] <= 0) {
          frq[o + 1]++;
          o++;
        } else
          frq[o + 1]++;
      }
      o++;
    }
    c++;
  }
  cout << c;
}
