#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int rank[105] = {0};
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    rank[t]++;
  }
  int res = 0;
  while (rank[k] < n) {
    for (int i = k - 1; i >= 1; --i) {
      if (rank[i]) {
        rank[i + 1]++;
        rank[i]--;
      }
    }
    res++;
  }
  cout << res << endl;
  return 0;
}
