#include <bits/stdc++.h>
using namespace std;
int n, k, cntr, a[200];
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    int num;
    cin >> num;
    a[num]++;
  }
  while (a[k] != n) {
    for (int i = k - 1; i > 0; i--) {
      if (a[i]) {
        a[i]--;
        a[i + 1]++;
      }
    }
    cntr++;
  }
  cout << cntr;
}
