#include <bits/stdc++.h>
using namespace std;
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, k, arr[102] = {}, a = 0;
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  while (arr[0] != k) {
    a++;
    for (int i = 0; i < n; i++) {
      if (arr[i] != arr[i + 1] && arr[i] < k) arr[i]++;
    }
  }
  cout << a << endl;
}
