#include <bits/stdc++.h>
using namespace std;
long long arr[105] = {};
int main() {
  bool istrue = false;
  long long a, b, x = -1, w = 0, m = 0;
  cin >> a >> b;
  for (int i = 0; i < a; i++) cin >> arr[i];
  for (int c = 0; c < a; ++c) {
    if (arr[c] != x && arr[c] < b) {
      x = arr[c];
      arr[c] += 1;
      istrue = true;
    }
    if (c == a - 1) {
      c = -1;
      if (istrue) {
        w++;
        istrue = false;
      }
      x = -1;
      for (int y = 0; y < a; y++) {
        if (arr[y] >= b) m++;
      }
      if (m == a) {
        cout << w << "\n";
        exit(0);
      } else
        m = 0;
      sort(arr, arr + a);
    }
  }
  return 0;
}
